| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #!/bin/bash
- # Stoppe le serveur Apache2 s'il est demarre
- if systemctl is-active --quiet apache2;
- then
- systemctl stop apache2
- fi
- # Creation et installation des certificats Let's Encrypt
- certbot certonly --standalone -d monrisquearteriel.com -d api.monrisquearteriel.com -d www.monrisquearteriel.com -d cro.monrisquearteriel.com
- # Configuration Apache2
- a2enmod headers rewrite ssl proxy proxy_http
- a2ensite ipsocloud.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 -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
- # Mettre les droits d'acces au repertoire storage/
- chmod 777 /var/www/storage/
- chmod 777 /var/www/storage/media/
- chmod 777 /var/www/storage/report/
- chown www-data:www-data /var/www/storage/tmp/
|