| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #!/bin/bash
- # Installation de certbot (client ACME de Let's Encrypt pour les certificats)
- snap install --classic certbot
- # Configuration Apache2
- [ -z "$(grep \/var\/www\/www /etc/apache2/apache2.conf)" ] && ed -s /etc/apache2/apache2.conf <<EOF
- /\#<Directory
- -i
- <Directory /var/www/www/>
- Options Indexes FollowSymLinks
- AllowOverride None
- Require all granted
- </Directory>
- .
- w
- EOF
- a2enmod headers
- a2enmod rewrite
- a2enmod ssl
- a2ensite api.conf
- a2ensite www.conf
- a2ensite cro.conf
- # Configuration PHP
- for i in /etc/php/*/apache2/php.ini;
- do
- if [ -f ${i} ];
- then
- ed -s ${i} <<EOF
- /upload_max_filesize
- s/2M/30M
- .
- w
- EOF
- fi
- done
- # Redemarrage du serveur Apache2
- systemctl restart apache2
- # Configuration de la base de donnees
- mysql_secure_installation
- mysql -u root <<EOF
- CREATE USER IF NOT EXISTS 'newuser'@'localhost';
- SET PASSWORD FOR 'newuser'@'localhost' = PASSWORD( 'password' );
- GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost';
- FLUSH PRIVILEGES;
- exit
- EOF
- # Ajoute les tables de Math-Cloud
- if [ -f /tmp/iimt_mathcloud.sql ] &&
- [ -f /tmp/iimt_mathcloud_audit.sql ] &&
- [ -f /tmp/iimt_mathcloud_shadow.sql ];
- then
- mysql -u root <<EOF
- SOURCE /tmp/iimt_mathcloud.sql
- SOURCE /tmp/iimt_mathcloud_audit.sql
- SOURCE /tmp/iimt_mathcloud_shadow.sql
- exit
- EOF
- fi
- # Redemarrage de la base de donnees
- systemctl restart mysql
|