Update trusty64 boostrap and add Apache optimisation

This commit is contained in:
Michael RICOIS 2014-12-19 22:18:20 +01:00
parent 594ad797c1
commit 9f0350dd14
3 changed files with 25 additions and 23 deletions

View File

@ -4,26 +4,6 @@ sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install htop unzip
# Installation MariaDB
MARIADB_VERSION='10.0'
MYSQL_PASS=scores
if [ ! -f /etc/mysql/vagrant ]
then
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://nwps.ws/pub/mariadb/repo/10.0/ubuntu trusty main'
sudo apt-get update
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password password $MYSQL_PASS"
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password_again password $MYSQL_PASS"
sudo apt-get -y --allow-unauthenticated install mariadb-server
#sudo sed -i -e 's/datadir = \/var\/lib\/mysql/datadir = \/home\/vhosts\/mysql/g' /etc/mysql/my.cnf
sudo sed -i "s/bind-address *= 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo sed -i "s/max_connections *= 100/max_connections = 20/" /etc/mysql/my.cnf
sudo service mysql restart
mysql -hlocalhost -uroot -p$MYSQL_PASS < /vagrant/data/pma.sql
sudo touch /etc/mysql/vagrant
fi
# Installation Wkhtmltopdf
if [ ! -f /usr/local/bin/wkhtmltopdf ]
then
@ -39,6 +19,26 @@ then
sudo a2enmod autoindex deflate expires headers rewrite
fi
# Installation MariaDB
MARIADB_VERSION='10.0'
MYSQL_PASS=scores
if [ ! -f /etc/mysql/vagrant ]
then
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://nwps.ws/pub/mariadb/repo/10.0/ubuntu trusty main'
sudo apt-get update
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password password $MYSQL_PASS"
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password_again password $MYSQL_PASS"
sudo apt-get -y --allow-unauthenticated install mariadb-server
#sudo sed -i -e 's/datadir = \/var\/lib\/mysql/datadir = \/home\/vhosts\/mysql/g' /etc/mysql/my.cnf
sudo sed -i "s/bind-address *= 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo sed -i "s/max_connections *= 100/max_connections = 20/" /etc/mysql/my.cnf
sudo service mysql restart
mysql -hlocalhost -uroot -p$MYSQL_PASS < /vagrant/data/pma.sql
sudo touch /etc/mysql/vagrant
fi
# Installation phpMyAdmin
PHPMYADMIN_VERSION='4.3.1'
if [ ! -d "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" ]
@ -117,7 +117,7 @@ for f in *.conf; do
then
sudo cp -f $f /etc/apache2/sites-available/;
VHOSTS+=" $f"
fi
fi
done;
sudo a2ensite $VHOSTS

View File

@ -4,8 +4,9 @@
UseCanonicalPhysicalPort On
DocumentRoot /home/vhosts/phpmyadmin
<Directory /home/vhosts/phpmyadmin/>
AllowOverride all
Require all granted
EnableSendfile Off
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.

View File

@ -4,6 +4,7 @@
UseCanonicalPhysicalPort On
DocumentRoot /home/vhosts/test
<Directory /home/vhosts/test/>
EnableSendfile Off
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted