Installation phpmyadmin
This commit is contained in:
parent
6247b7dc41
commit
da5559b88a
@ -34,8 +34,7 @@ then
|
||||
sudo apt-get update
|
||||
sudo debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password password $MYSQL_PASS"
|
||||
sudo 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 apt-get -y --allow-unauthenticated install mariadb-server mariadb-client
|
||||
sudo sed -i -e 's/bind-address[ \t]*= 127.0.0.1/bind-address = 0.0.0.0/g' /etc/mysql/my.cnf
|
||||
sudo sed -i -e 's/max_connections[ \t]*= 100/max_connections = 20/g' /etc/mysql/my.cnf
|
||||
sudo touch /etc/mysql/vagrant
|
||||
@ -58,7 +57,7 @@ if [ ! -f /usr/bin/php5 ]
|
||||
then
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install htop unzip apache2 mysql-client-5.5 php5 php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
|
||||
sudo apt-get -y install htop unzip apache2 php5 php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
|
||||
if [ $VARGANTDEV -eq 1 ]
|
||||
then
|
||||
sudo apt-get -y install php5-xdebug
|
||||
@ -104,20 +103,26 @@ then
|
||||
|
||||
fi
|
||||
|
||||
# --- Installation phpMyAdmin
|
||||
PHPMYADMIN_PATH="phpMyAdmin-$PHPMYADMIN_VERSION-all-languages"
|
||||
PHPMYADMIN_URL="https://files.phpmyadmin.net/phpMyAdmin"
|
||||
if [ ! -d "/home/vhosts/$PHPMYADMIN_VERSION/$PHPMYADMIN_PATH" ]
|
||||
# --- Composer
|
||||
if [ ! -f /bin/composer ]
|
||||
then
|
||||
wget "$PHPMYADMIN_URL/$PHPMYADMIN_VERSION/$PHPMYADMIN_PATH.tar.xz" -O "$DIRDATA/Apps/$PHPMYADMIN_PATH.tar.xz"
|
||||
if [ -f "$DIRDATA/Apps/$PHPMYADMIN_PATH.tar.xz" ]
|
||||
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=bin --filename=composer
|
||||
fi
|
||||
|
||||
# --- Installation phpMyAdmin
|
||||
PHPMYADMIN_DIR="phpMyAdmin-$PHPMYADMIN_VERSION-all-languages"
|
||||
PHPMYADMIN_URL="https://files.phpmyadmin.net/phpMyAdmin"
|
||||
if [ ! -d "/home/vhosts/$PHPMYADMIN_DIR" ]
|
||||
then
|
||||
wget -q "$PHPMYADMIN_URL/$PHPMYADMIN_VERSION/$PHPMYADMIN_DIR.tar.xz" -O "/home/vagrant/$PHPMYADMIN_DIR.tar.xz"
|
||||
if [ -f "/home/vagrant/$PHPMYADMIN_DIR.tar.xz" ]
|
||||
then
|
||||
tar xJvf "$DIRDATA/Apps/$PHPMYADMIN_PATH.tar.xz" --directory /home/vhosts/
|
||||
tar xJvf "/home/vagrant/$PHPMYADMIN_DIR.tar.xz" --directory /home/vhosts/
|
||||
mysql -hlocalhost -uroot -p$MYSQL_PASS < $DIRDATA/Apps/phpmyadmin.sql
|
||||
mysql -hlocalhost -uroot -p$MYSQL_PASS < /home/vhosts/$PHPMYADMIN_PATH/sql/create_tables.sql
|
||||
mysql -hlocalhost -uroot -p$MYSQL_PASS < /home/vhosts/$PHPMYADMIN_DIR/sql/create_tables.sql
|
||||
sudo service mysql restart
|
||||
cp $DIRDATA/Apps/config.inc.php /home/vhosts/$PHPMYADMIN_PATH/
|
||||
chmod 0444 /home/vhosts/$PHPMYADMIN_PATH/config.inc.php
|
||||
cp $DIRDATA/Apps/config.inc.php /home/vhosts/$PHPMYADMIN_DIR/
|
||||
chmod 0444 /home/vhosts/$PHPMYADMIN_DIR/config.inc.php
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -141,8 +146,11 @@ for f in *.conf; do
|
||||
sudo rm -vf /etc/apache2/sites-available/$f;
|
||||
done;
|
||||
|
||||
# --- phpmyadmin.sd.dev && test.sd.dev
|
||||
cp -f $DIRDATA/Apache/phpmyadmin.conf $DIR/vhosts/phpmyadmin.conf
|
||||
# --- phpmyadmin.sd.dev
|
||||
cp -f $DIRDATA/Apache/phpmyadmin.conf $DIR/vhosts/phpmyadmin.conf
|
||||
sed -i -e 's/VERSION/"$PHPMYADMIN_VERSION"/g' $DIR/vhosts/phpmyadmin.conf
|
||||
|
||||
# --- test.sd.dev
|
||||
cp -f $DIRDATA/Apache/test.conf /etc/apache2/sites-available/test.conf
|
||||
if [ ! -d /home/vhosts/test ]
|
||||
then
|
||||
|
@ -1 +0,0 @@
|
||||
ServerName 127.0.0.1
|
@ -2,8 +2,8 @@
|
||||
ServerName phpmyadmin.sd.dev
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
DocumentRoot /home/vhosts/phpMyAdmin-4.5.1-all-languages
|
||||
<Directory /home/vhosts/phpMyAdmin-4.5.1-all-languages/>
|
||||
DocumentRoot /home/vhosts/phpMyAdmin-VERSION-all-languages
|
||||
<Directory /home/vhosts/phpMyAdmin-VERSION-all-languages/>
|
||||
EnableSendfile Off
|
||||
AllowOverride all
|
||||
Require all granted
|
||||
|
Loading…
Reference in New Issue
Block a user