| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #!/bin/bash
- # 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
- if [ -f /etc/php/7.4/apache2/php.ini ];
- then
- ed -s /etc/php/7.4/apache2/php.ini <<EOF
- /upload_max_filesize
- s/2M/30M
- .
- w
- EOF
- fi
- # 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
|