« Installation de PhpMyFaq sur Ubuntu 22.04 » : différence entre les versions

De www.yakakliker.org
Ligne 3 : Ligne 3 :


=== Installation des tools nécessaires au bon fonctionnement ===
=== Installation des tools nécessaires au bon fonctionnement ===
<syntaxhighlight lang="bash">
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install net-tools
sudo apt-get install net-tools
</syntaxhighlight>


=== Installation de Webmin ===
=== Installation de Webmin ===
curl -o setup-repos.sh <nowiki>https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh</nowiki>
<syntaxhighlight lang="bash">
 
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh
sh setup-repos.sh
apt-get install webmin
apt-get install webmin
</syntaxhighlight>


=== Installation du SD-WAN Zerotier ===
=== Installation du SD-WAN Zerotier ===
curl -s <nowiki>https://install.zerotier.com</nowiki> | sudo bash
<syntaxhighlight lang="bash">
 
curl -s https://install.zerotier.com | sudo bash
curl -o Zerotier.sh <nowiki>https://raw.githubusercontent.com/Yakakliker37/Base_info/main/Zerotier.sh</nowiki>
curl -o Zerotier.sh https://raw.githubusercontent.com/Yakakliker37/Base_info/main/Zerotier.sh
 
sh Zerotier.sh
sh Zerotier.sh
</syntaxhighlight>


== Installation des pré-requis nécessaires à GLPI ==
== Installation des pré-requis nécessaires à GLPI ==
Ligne 35 : Ligne 36 :


=== Configuration de la base de données ===
=== Configuration de la base de données ===
<syntaxhighlight lang="bash">
sudo mysql_secure_installation
sudo mysql_secure_installation


Ligne 142 : Ligne 144 :


quit
quit
</syntaxhighlight>


=== Installation de Phpmyfaq ===
=== Installation de Phpmyfaq ===
wget <nowiki>https://download.phpmyfaq.de/phpMyFAQ-3.1.11.tar.gz</nowiki>
<syntaxhighlight lang="bash">
wget https://download.phpmyfaq.de/phpMyFAQ-3.1.11.tar.gz


tar -xzvf phpMyFAQ-3.1.11.tar.gz
tar -xzvf phpMyFAQ-3.1.11.tar.gz
Ligne 155 : Ligne 159 :


sudo chmod -R 775 /var/www/phpmyfaq
sudo chmod -R 775 /var/www/phpmyfaq
</syntaxhighlight>


=== Sécurisation du serveur web ===
=== Sécurisation du serveur web ===
<syntaxhighlight lang="bash">
mkdir /etc/ssl/phpmyfaq/
mkdir /etc/ssl/phpmyfaq/


Ligne 183 : Ligne 189 :
If you enter '.', the field will be left blank.
If you enter '.', the field will be left blank.


<nowiki>-----</nowiki>
-----


Country Name (2 letter code) [AU]:FR
Country Name (2 letter code) [AU]:FR
Ligne 217 : Ligne 223 :
If you enter '.', the field will be left blank.
If you enter '.', the field will be left blank.


<nowiki>-----</nowiki>
-----


Country Name (2 letter code) [AU]:FR
Country Name (2 letter code) [AU]:FR
Ligne 262 : Ligne 268 :


Enter pass phrase for domaintestCA.key:
Enter pass phrase for domaintestCA.key:
</syntaxhighlight>


=== Configuration du VHOST Apache ===
=== Configuration du VHOST Apache ===
<syntaxhighlight lang="bash">
sudo nano /etc/apache2/sites-available/phpmyfaq.conf
sudo nano /etc/apache2/sites-available/phpmyfaq.conf


Ligne 272 : Ligne 280 :
ServerName phpmyfaq
ServerName phpmyfaq


Redirect permanent / <nowiki>https://phpmyfaq/</nowiki>
Redirect permanent / https://phpmyfaq/


ErrorLog ${APACHE_LOG_DIR}/phpmyfaq_error.log
ErrorLog ${APACHE_LOG_DIR}/phpmyfaq_error.log
Ligne 316 : Ligne 324 :
sudo systemctl restart apache2
sudo systemctl restart apache2


Lancer la fin de l'installation via l'adresse <nowiki>https://ip_du_serveur/</nowiki>
Lancer la fin de l'installation via l'adresse https://ip_du_serveur/
</syntaxhighlight>
[[Catégorie:Installation]]
[[Catégorie:Installation]]
[[Catégorie:Linux]]
[[Catégorie:Linux]]
[[Catégorie:Howto]]
[[Catégorie:Howto]]

Version du 14 juin 2024 à 10:58

Installation du système

Installation des tools nécessaires au bon fonctionnement

sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install net-tools

Installation de Webmin

curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh
apt-get install webmin

Installation du SD-WAN Zerotier

curl -s https://install.zerotier.com | sudo bash
curl -o Zerotier.sh https://raw.githubusercontent.com/Yakakliker37/Base_info/main/Zerotier.sh
sh Zerotier.sh

Installation des pré-requis nécessaires à GLPI

sudo apt-get install apache2 -y

sudo systemctl enable apache2

sudo apt-get install mariadb-server -y

sudo apt-get install php libapache2-mod-php -y

sudo apt-get install php-{ldap,imap,apcu,xmlrpc,curl,common,gd,json,mbstring,mysql,xml,intl,zip,bz2}

Configuration de la base de données

sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user. If you've just installed MariaDB, and

haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody

can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] Y

Enabled successfully!

Reloading privilege tables..

... Success!

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] Y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] Y

... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y

... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] Y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] Y

... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

mysql -u root -p

create database phpmyfaqdb character set utf8 collate utf8_bin;

grant all privileges on phpmyfaqdb.* to phpmyfaq@localhost identified by 'Mot_de_passe';

flush privileges;

quit

Installation de Phpmyfaq

wget https://download.phpmyfaq.de/phpMyFAQ-3.1.11.tar.gz

tar -xzvf phpMyFAQ-3.1.11.tar.gz

sudo mkdir /var/www/phpmyfaq

sudo cp -R phpmyfaq/* /var/www/phpmyfaq/

sudo chown -R www-data:www-data /var/www/phpmyfaq

sudo chmod -R 775 /var/www/phpmyfaq

Sécurisation du serveur web

mkdir /etc/ssl/phpmyfaq/

cd /etc/ssl/phpmyfaq/

openssl genrsa -des3 -out phpmyfaqCA.key 2048

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

openssl req -x509 -new -nodes -key phpmyfaqCA.key -sha256 -days 3650 -out phpmyfaqCA.pem

Enter pass phrase for phpmyfaqCA.key:

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [AU]:FR

State or Province Name (full name) [Some-State]:DS

Locality Name (eg, city) []:City

Organization Name (eg, company) [Internet Widgits Pty Ltd]:SERVICE

Organizational Unit Name (eg, section) []:IT

Common Name (e.g. server FQDN or YOUR name) []:phpmyfaq

Email Address []:admin@phpmyfaq.loc

openssl x509 -in phpmyfaqCA.pem -inform PEM -out phpmyfaqCA.crt

openssl genrsa -out wildcard.phpmyfaq.key 2048

openssl req -new -key wildcard.phpmyfaq.key -out wildcard.phpmyfaq.csr

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [AU]:FR

State or Province Name (full name) [Some-State]:DS

Locality Name (eg, city) []:City

Organization Name (eg, company) [Internet Widgits Pty Ltd]:SERVICE

Organizational Unit Name (eg, section) []:IT

Common Name (e.g. server FQDN or YOUR name) []:phpmyfaq

Email Address []:admin@phpmyfaq.loc

Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:

An optional company name []:

nano wildcard.phpmyfaq.ext

authorityKeyIdentifier=keyid,issuer

basicConstraints=CA:FALSE

keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment

subjectAltName = @alt_names

[alt_names]

DNS.1 = *.phpmyfaq.yakakliker.org

openssl x509 -req -in wildcard.phpmyfaq.csr -CA phpmyfaqCA.pem -CAkey phpmyfaqCA.key -CAcreateserial -out wildcard.phpmyfaq.crt -days 3650 -sha256 -extfile wildcard.phpmyfaq.ext

Certificate request self-signature ok

subject=C = FR, ST = DS, L = City, O = SERVICE, OU = IT, CN = phpmyfaq, emailAddress = admin@phpmyfaq.loc

Enter pass phrase for domaintestCA.key:

Configuration du VHOST Apache

sudo nano /etc/apache2/sites-available/phpmyfaq.conf

<VirtualHost *:80>

DocumentRoot /var/www/phpmyfaq

ServerName phpmyfaq

Redirect permanent / https://phpmyfaq/

ErrorLog ${APACHE_LOG_DIR}/phpmyfaq_error.log

CustomLog ${APACHE_LOG_DIR}/phpmyfaq_access.log combined

</VirtualHost>

<VirtualHost *:443>

ServerAdmin admin@example.com

DocumentRoot /var/www/phpmyfaq

ServerName phpmyfaq

SSLEngine On

SSLCertificateFile /etc/ssl/phpmyfaq/wildcard.phpmyfaq.crt

SSLCertificateKeyFile /etc/ssl/phpmyfaq/wildcard.phpmyfaq.key

<Directory /var/www/phpmyfaq>

Options FollowSymlinks

AllowOverride All

Require all granted

</Directory>

ErrorLog ${APACHE_LOG_DIR}/phpmyfaq_error.log

CustomLog ${APACHE_LOG_DIR}/phpmyfaq_access.log combined

</VirtualHost>

sudo a2enmod ssl

sudo ln -s /etc/apache2/sites-available/phpmyfaq.conf /etc/apache2/sites-enabled/phpmyfaq.conf

sudo systemctl restart apache2

Lancer la fin de l'installation via l'adresse https://ip_du_serveur/