Browse Source

Change phpMyAdmin Installation

old-stable
Mitesh Shah 12 years ago
parent
commit
2e806c1d58
  1. 18
      etc/nginx/common/locations.conf
  2. 206
      usr/local/sbin/easyengine

18
etc/nginx/common/locations.conf

@ -21,30 +21,30 @@ location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif
} }
# PMA Settings # PMA Settings
location /phpmyadmin { location /pma {
root /usr/share/; root /var/www/;
index index.php index.html index.htm; index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ { location ~ ^/pma/(.+\.php)$ {
try_files $uri =404; try_files $uri =404;
root /usr/share/; root /var/www/;
fastcgi_pass php; fastcgi_pass php;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
} }
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { location ~* ^/pma/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/; root /var/www/;
} }
} }
location /phpMyAdmin { location /phpMyAdmin {
rewrite ^/* /phpmyadmin last; rewrite ^/* /pma last;
} }
location /pma { location /phpmyadmin {
rewrite ^/* /phpmyadmin last; rewrite ^/* /pma last;
} }
# Status Pages # Status Pages

206
usr/local/sbin/easyengine

@ -48,14 +48,6 @@ PHPREPO()
|| OwnError "Unable To Add PHP5 Launchpad Repository" || OwnError "Unable To Add PHP5 Launchpad Repository"
} }
PHPMYADMINREPO()
{
# Add phpMyAdmin Launchpad Repository
echo -e "\033[34m Adding phpMyAdmin Launchpad Repository... \e[0m"
sudo add-apt-repository ppa:nijel/phpmyadmin \
|| OwnError "Unable To Add phpMyAdmin Launchpad Repository"
}
GPGKEY() GPGKEY()
{ {
# Force GPG KEYS Check # Force GPG KEYS Check
@ -132,20 +124,49 @@ CHANGEPHPSOCKET()
|| OwnError "Unable To Change PHP Fastcgi Socket" || OwnError "Unable To Change PHP Fastcgi Socket"
} }
INSTALLMYSQL() WP-CLI()
{ {
# Install MySQL # Install WP-CLI
echo -e "\033[34m Installing MySQL... \e[0m" if [ ! -d /usr/share/easyengine/wp-cli ]
sudo $EEAPTGET install mysql-server mysqltuner \ then
|| OwnError "Unable To Install MySQL" echo -e "\033[31m WP Command Not Found ! \e[0m"
echo -e "\033[34m Installing WP-CLI, Please Wait... \e[0m"
curl http://wp-cli.org/installer.sh | INSTALL_DIR='/usr/share/easyengine/wp-cli' bash \
|| OwnError "Unable To Install WP-CLI"
# Add WP Command In PATH Variable
ln -s /usr/share/easyengine/wp-cli/bin/wp /usr/bin/wp || OwnError "Unable To Create Symbolic Link For WP Command"
# Add WP Auto Completion
cp -vi /usr/share/easyengine/wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash /etc/bash_completion.d/
source /etc/bash_completion.d/wp-completion.bash
fi
} }
INSTALLPMA() INSTALLPMA()
{ {
# Install PMA # Install PMA/phpMyAdmin
echo -e "\033[34m Installing PMA... \e[0m" echo -e "\033[34m Installing PMA... \e[0m"
sudo $EEAPTGET install phpmyadmin \
|| OwnError "Unable To Install PMA" # Setup PMA/phpMyAdmin
mkdir -p /var/www/pma || OwnError "Unable To Create Directory: /var/www/pma"
# Download PMA/phpMyAdmin
cd /var/www/pma || OwnError "Unable To Change Directory: /var/www/pma"
wget -c http://dl.cihar.com/phpMyAdmin/master/phpMyAdmin-master-latest.tar.gz \
|| OwnError "Unable To Download PMA"
# Extract PMA/phpMyAdmin
tar --strip-components=1 -zxvf phpMyAdmin-master-latest.tar.gz -C /var/www/pma \
|| OwnError "Unable To Extract PMA"
}
INSTALLMYSQL()
{
# Install MySQL
echo -e "\033[34m Installing MySQL... \e[0m"
sudo $EEAPTGET install mysql-server mysqltuner \
|| OwnError "Unable To Install MySQL"
} }
INSTALLPOSTFIX() INSTALLPOSTFIX()
@ -161,27 +182,8 @@ INSTALLALL()
echo -e "\033[34m Installing Nginx PHP5 MySQL Postfix... \e[0m" echo -e "\033[34m Installing Nginx PHP5 MySQL Postfix... \e[0m"
sudo $EEAPTGET install nginx-custom php5-common php5-mysqlnd php5-xmlrpc \ sudo $EEAPTGET install nginx-custom php5-common php5-mysqlnd php5-xmlrpc \
php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear \ php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear \
php5-dev php5-imap php5-mcrypt mysql-server mysqltuner phpmyadmin postfix \ php5-dev php5-imap php5-mcrypt mysql-server mysqltuner postfix \
|| OwnError "Unable To Install Nginx PHP5 MySQL PMA Postfix" || OwnError "Unable To Install Nginx PHP5 MySQL Postfix"
}
WP-CLI()
{
# Install WP-CLI
if [ ! -d /usr/share/easyengine/wp-cli ]
then
echo -e "\033[31m WP Command Not Found ! \e[0m"
echo -e "\033[34m Installing WP-CLI, Please Wait... \e[0m"
curl http://wp-cli.org/installer.sh | INSTALL_DIR='/usr/share/easyengine/wp-cli' bash \
|| OwnError "Unable To Install WP-CLI"
# Add WP Command In PATH Variable
ln -s /usr/share/easyengine/wp-cli/bin/wp /usr/bin/wp || OwnError "Unable To Create Symbolic Link For WP Command"
# Add WP Auto Completion
cp -vi /usr/share/easyengine/wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash /etc/bash_completion.d/
source /etc/bash_completion.d/wp-completion.bash
fi
} }
@ -202,22 +204,29 @@ REMOVEPHP()
php5-dev php5-imap php5-mcrypt || OwnError "Unable To Remove PHP5" php5-dev php5-imap php5-mcrypt || OwnError "Unable To Remove PHP5"
} }
REMOVEMYSQL() REMOVEWPCLI()
{ {
# Remove MySQL # Remove WP-CLI
echo -e "\033[34m Removing MySQL... \e[0m" echo -e "\033[34m Removing WP-CLI... \e[0m"
sudo $EEAPTGET remove mysql-server mysqltuner \ sudo rm -rf /var/www/wp-cli || OwnError "Unable To Remove WP-CLI"
|| OwnError "Unable To Remove MySQL"
} }
REMOVEPMA() REMOVEPMA()
{ {
# Remove PMA # Remove PMA/phpMyAdmin
echo -e "\033[34m Installing PMA... \e[0m" echo -e "\033[34m Removing PMA... \e[0m"
sudo $EEAPTGET remove phpmyadmin \ sudo rm -rf /var/www/pma \
|| OwnError "Unable To Remove PMA" || OwnError "Unable To Remove PMA"
} }
REMOVEMYSQL()
{
# Remove MySQL
echo -e "\033[34m Removing MySQL... \e[0m"
sudo $EEAPTGET remove mysql-server mysqltuner \
|| OwnError "Unable To Remove MySQL"
}
REMOVEPOSTFIX() REMOVEPOSTFIX()
{ {
# Remove Postfix # Remove Postfix
@ -231,15 +240,8 @@ REMOVEALL()
echo -e "\033[34m Removing Nginx PHP5 MySQL Postfix... \e[0m" echo -e "\033[34m Removing Nginx PHP5 MySQL Postfix... \e[0m"
sudo $EEAPTGET remove nginx-custom php5-common php5-mysqlnd php5-xmlrpc \ sudo $EEAPTGET remove nginx-custom php5-common php5-mysqlnd php5-xmlrpc \
php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear \ php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear \
php5-dev php5-imap php5-mcrypt mysql-server mysqltuner phpmyadmin postfix \ php5-dev php5-imap php5-mcrypt mysql-server mysqltuner postfix \
|| OwnError "Unable To Remove Nginx PHP5 MySQL PMA Postfix" || OwnError "Unable To Remove Nginx PHP5 MySQL Postfix"
}
REMOVEWPCLI()
{
# Remove WP-CLI
echo -e "\033[34m Removing WP-CLI... \e[0m"
sudo rm -rf /var/www/wp-cli || OwnError "Unable To Remove WP-CLI"
} }
AUTOREMOVE() AUTOREMOVE()
@ -275,14 +277,6 @@ PURGEMYSQL()
|| OwnError "Unable To Purge MySQL" || OwnError "Unable To Purge MySQL"
} }
PURGEPMA()
{
# Purge PMA
echo -e "\033[34m Installing PMA... \e[0m"
sudo $EEAPTGET purge phpmyadmin \
|| OwnError "Unable To Purge PMA"
}
PURGEPOSTFIX() PURGEPOSTFIX()
{ {
# Purge Postfix # Purge Postfix
@ -296,8 +290,8 @@ PURGEALL()
echo -e "\033[34m Removing Nginx PHP5 MySQL Postfix... \e[0m" echo -e "\033[34m Removing Nginx PHP5 MySQL Postfix... \e[0m"
sudo $EEAPTGET purge nginx-custom php5-common php5-mysqlnd php5-xmlrpc \ sudo $EEAPTGET purge nginx-custom php5-common php5-mysqlnd php5-xmlrpc \
php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear \ php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear \
php5-dev php5-imap php5-mcrypt mysql-server mysqltuner phpmyadmin postfix \ php5-dev php5-imap php5-mcrypt mysql-server mysqltuner postfix \
|| OwnError "Unable To Purge Nginx PHP5 MySQL PMA Postfix" || OwnError "Unable To Purge Nginx PHP5 MySQL Postfix"
} }
@ -790,43 +784,34 @@ then
# Display Success Message # Display Success Message
echo -e "\033[34m PHP5 Successfully Installed \e[0m" echo -e "\033[34m PHP5 Successfully Installed \e[0m"
elif [ "$3" = "mysql" ] elif [ "$3" = "pma" ]
then then
# Update The APT Cache # Install PMA
UPDATEAPT INSTALLPMA
# Install MySQL
INSTALLMYSQL
# Initialise Git # Initialise Git
EEGITDIR=/etc/mysql/ EEGITDIR=/var/www/pma/
EEGITINIT EEGITINIT
# Display Success Message # Display Success Message
echo -e "\033[34m MySQL Successfully Installed \e[0m" echo -e "\033[34m PMA Successfully Installed \e[0m"
elif [ "$3" = "pma" ] elif [ "$3" = "mysql" ]
then then
# Install Python Software Properties
PYTHONSOFTWARE
# Add phpMyAdmin Launchpad Repository
PHPMYADMINREPO
# Update The APT Cache # Update The APT Cache
UPDATEAPT UPDATEAPT
# Install PMA # Install MySQL
INSTALLPMA INSTALLMYSQL
# Initialise Git # Initialise Git
EEGITDIR=/etc/phpmyadmin/ EEGITDIR=/etc/mysql/
EEGITINIT EEGITINIT
# Display Success Message # Display Success Message
echo -e "\033[34m PMA Successfully Installed \e[0m" echo -e "\033[34m MySQL Successfully Installed \e[0m"
elif [ "$3" = "postfix" ] elif [ "$3" = "postfix" ]
then then
@ -856,16 +841,13 @@ then
# Add PHP Launchpad Repository # Add PHP Launchpad Repository
PHPREPO PHPREPO
# Add phpMyAdmin Launchpad Repository
PHPMYADMINREPO
# Fix GPG Key Problems # Fix GPG Key Problems
GPGKEY GPGKEY
# Update The APT Cache # Update The APT Cache
UPDATEAPT UPDATEAPT
# Install Nginx PHP5 MySQL PMA Postfix # Install Nginx PHP5 MySQL Postfix
INSTALLALL INSTALLALL
# Personal Settings For Nginx # Personal Settings For Nginx
@ -883,6 +865,9 @@ then
# Install WP-CLI # Install WP-CLI
WP-CLI WP-CLI
# Install PMA/phpMyAdmin
INSTALLPMA
# Initialise Git # Initialise Git
EEGITDIR=/etc/nginx/ EEGITDIR=/etc/nginx/
EEGITINIT EEGITINIT
@ -896,7 +881,7 @@ then
EEGITINIT EEGITINIT
# Initialise Git # Initialise Git
EEGITDIR=/etc/phpmyadmin/ EEGITDIR=/var/www/pma/
EEGITINIT EEGITINIT
# Initialise Git # Initialise Git
@ -904,7 +889,7 @@ then
EEGITINIT EEGITINIT
# Display Success Message # Display Success Message
echo -e "\033[34m Nginx PHP5 MySQL PMA Postfix Successfully Installed \e[0m" echo -e "\033[34m Nginx PHP5 PMA MySQL Postfix Successfully Installed \e[0m"
fi fi
@ -938,29 +923,26 @@ then
# Display Success Message # Display Success Message
echo -e "\033[34m PHP5 Successfully Removed \e[0m" echo -e "\033[34m PHP5 Successfully Removed \e[0m"
elif [ "$3" = "mysql" ] elif [ "$3" = "pma" ]
then then
# Remove MySQL # Remove PMA
REMOVEMYSQL REMOVEPMA
# Remove Unwanted Packages
AUTOREMOVE
# Display Success Message # Display Success Message
echo -e "\033[34m MySQL Successfully Removed \e[0m" echo -e "\033[34m PMA Successfully Removed \e[0m"
elif [ "$3" = "pma" ] elif [ "$3" = "mysql" ]
then then
# Remove PMA # Remove MySQL
REMOVEPMA REMOVEMYSQL
# Remove Unwanted Packages # Remove Unwanted Packages
AUTOREMOVE AUTOREMOVE
# Display Success Message # Display Success Message
echo -e "\033[34m PMA Successfully Removed \e[0m" echo -e "\033[34m MySQL Successfully Removed \e[0m"
elif [ "$3" = "postfix" ] elif [ "$3" = "postfix" ]
then then
@ -983,9 +965,10 @@ then
# Remove Unwanted Packages # Remove Unwanted Packages
AUTOREMOVE AUTOREMOVE
REMOVEWPCLI REMOVEWPCLI
REMOVEPMA
# Display Success Message # Display Success Message
echo -e "\033[34m Nginx PHP5 MySQL PMA Postfix Successfully Removed \e[0m" echo -e "\033[34m Nginx PHP5 PMA MySQL Postfix Successfully Removed \e[0m"
fi fi
@ -1019,29 +1002,26 @@ then
# Display Success Message # Display Success Message
echo -e "\033[34m PHP5 Successfully Purged \e[0m" echo -e "\033[34m PHP5 Successfully Purged \e[0m"
elif [ "$3" = "mysql" ] elif [ "$3" = "pma" ]
then then
# Purge MySQL # Purge PMA
PURGEMYSQL REMOVEPMA
# Remove Unwanted Packages
AUTOREMOVE
# Display Success Message # Display Success Message
echo -e "\033[34m MySQL Successfully Purged \e[0m" echo -e "\033[34m PMA Successfully Purged \e[0m"
elif [ "$3" = "pma" ] elif [ "$3" = "mysql" ]
then then
# Purge PMA # Purge MySQL
PURGEPMA PURGEMYSQL
# Remove Unwanted Packages # Remove Unwanted Packages
AUTOREMOVE AUTOREMOVE
# Display Success Message # Display Success Message
echo -e "\033[34m PMA Successfully Purged \e[0m" echo -e "\033[34m MySQL Successfully Purged \e[0m"
elif [ "$3" = "postfix" ] elif [ "$3" = "postfix" ]
then then
@ -1066,7 +1046,7 @@ then
AUTOREMOVE AUTOREMOVE
# Display Success Message # Display Success Message
echo -e "\033[34m Nginx PHP5 MySQL PMA Postfix Successfully Purged \e[0m" echo -e "\033[34m Nginx PHP5 PMA MySQL Postfix Successfully Purged \e[0m"
fi fi

Loading…
Cancel
Save