diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index 62c9f5b..f8b5cd7 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -1,11 +1,10 @@ ## Release Notes: ## -### 5.6.0 ### +### 6.0.0 ### - * Support for Ubuntu Precise (12.04). - * Fix some of the library paths. - * PHP Upstream release (5.3.11 and 5.4.1) - * NginX Upstream release (1.2.0) + * The script is now completely unattended. + * Added an OPTIONS file that contains all program versions and paths. + * Improved the final screen. It should now check for the external IP address. ### 5.5.0 ### diff --git a/OPTIONS b/OPTIONS new file mode 100644 index 0000000..babd05c --- /dev/null +++ b/OPTIONS @@ -0,0 +1,35 @@ +#!/bin/bash + +# Enable the script? +ENABLED='no' + +### Program Versions: ######################################################### + +# NginX Version: +# Ex: NGINX_VERSION='1.2.0' +NGINX_VERSION='1.2.0' + +# PHP Version: +# Ex: PHP_VERSION='5.4.1' +PHP_VERSION='5.4.1' + +# APC Version: +# Ex: APC_VERSION='3.1.10' +APC_VERSION='3.1.10' + +# Suhosin Version: +# Ex: SUHOSIN_VERSION='0.9.33' +SUHOSIN_VERSION='0.9.33' + +############################################################################### + +### Directories ############################################################### + +# Destination directory (where to install the software) +DESTINATION_DIR='/opt' + +# Web files directory +WEB_DIR='/var/www' + +############################################################################### + diff --git a/README.mkd b/README.mkd index 81ece18..3e29838 100644 --- a/README.mkd +++ b/README.mkd @@ -1,12 +1,8 @@ -This package represents a script to install the latest NginX, MySQL and PHP (with APC and Suhosin): +This package represents a script to install the latest NginX, MySQL and PHP (with APC and Suhosin). +Note: At this moment the Suhosin extension is not available for PHP 5.4. +You can install your preferred versions for any of the programs. Just edit the OPTIONS file and change them accordingly. - * NginX 1.2.0 (development) or 1.2.0 (stable) - * PHP 5.3.11 or PHP 5.4.1 - * APC 3.1.10 - * Suhosin Extension 0.9.33 (at this moment it is not available with PHP 5.4) - -All the steps are described at http://vladgh.com/blog/install-nginx-and-php-php-fpm-mysql-and-apc -It's highly recommended to run this installer on a fresh installed system. +It is highly recommended to run this installer on a fresh installed system. This is tested with Ubuntu 10.04, 11.10 and 12.04, both 32 bits and 64 bits, on official Amazon EC2 Ubuntu images. ####If you find this interesting and you want to keep the development active, please click on the button below to donate:### @@ -23,9 +19,17 @@ Clone this repository, and get the latest stable version of this script: git clone git://github.com/vladgh/VladGh.com-LEMP.git cd VladGh.com-LEMP -Run the installer; I recommend running everything inside a screen session because if your connection drops you can easily come back with `screen -rad` +Start a screen session: + + screen + +I recommend running everything inside a screen session because if your connection drops you can easily come back with `screen -rad`. If you use something else (ex: byobu) you can skip this step. + +Edit the OPTIONS files and change `ENABLED='yes'`. This is were you can modify the versions for any of the programs, and paths. + +Run the installer: - sudo screen ./install.sh + sudo ./install.sh After the installer is finished (this will take a long time depending on your server specifications), you MUST set your mysql root password: diff --git a/install.sh b/install.sh index 92509ad..09fa6a4 100755 --- a/install.sh +++ b/install.sh @@ -4,9 +4,11 @@ #################### ### LICENSE: ### #################### -# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. -# To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ -# or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. +# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 +# Unported License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to +# CreativeCommons, 444 Castro Street, Suite 900 +# Mountain View, California, 94041, USA. # ################### ### DISCLAIMER: ### @@ -20,36 +22,27 @@ # and testing purposes only. If you care about stability and security # you should use the packages provided by your distribution. -### Program Versions: -NGINX_STABLE="1.2.0" -NGINX_DEV="1.2.0" -PHP_53="5.3.11" -PHP_54="5.4.1" -APC_VER="3.1.10" -SUHOSIN_VER="0.9.33" - -### Directories -DSTDIR="/opt" -WEBDIR="/var/www" +# Directories SRCDIR=`dirname $(readlink -f $0)` +OPTIONSFILE="${SRCDIR}/OPTIONS" TMPDIR="${SRCDIR}/sources" INSTALL_FILES="${SRCDIR}/install_files/*.sh" +LOG_FILE="${SRCDIR}/install.log" -### Log file -LOG_FILE="install.log" - -### Active user +# Active user USER=$(who mom likes | awk '{print $1}') -# Load installation files +# Load options and installation files +. $OPTIONSFILE for file in ${INSTALL_FILES} ; do . ${file} done -################################################################################### +############################################################################### ### RUN ALL THE FUNCTIONS: check_root +check_options log2file # Traps CTRL-C @@ -59,65 +52,34 @@ function ctrl_c() { } clear >&3 -echo '=========================================================================' >&3 +echo '===============================================================================' >&3 echo 'This script will install the following:' >&3 -echo '=========================================================================' >&3 -echo " - Nginx ${NGINX_DEV} (development) or ${NGINX_STABLE} (stable);" >&3 -echo " - PHP ${PHP_53} or ${PHP_54};" >&3 -echo " - APC ${APC_VER};" >&3 -echo " - Suhosin ${SUHOSIN_VER} (at this moment not available for PHP 5.4)" >&3 -echo '=========================================================================' >&3 +echo '===============================================================================' >&3 +echo " - Nginx ${NGINX_VERSION};" >&3 +echo " - PHP ${PHP_VERSION};" >&3 +echo " - APC ${APC_VERSION};" >&3 +if [[ $PHP_VERSION != 5.4* ]]; then + echo " - Suhosin ${SUHOSIN_VERSION}." >&3 +fi +echo '===============================================================================' >&3 echo 'For more information please visit:' >&3 echo 'https://github.com/vladgh/VladGh.com-LEMP' >&3 -echo '=========================================================================' >&3 -echo 'Do you want to continue[Y/n]:' >&3 -read continue_install -case $continue_install in - 'n'|'N'|'No'|'no') - echo -e "\nCancelled." >&3 - exit 1 - ;; - *) -esac - -echo 'Which of the following PHP releases do you want installed:' >&3 -echo "1) Current PHP 5.3 Stable (${PHP_53})(default)" >&3 -echo "2) Current PHP 5.4 Stable (${PHP_54})(at this moment without the Suhosin extension)" >&3 -echo -n 'Enter your menu choice [1 or 2]: ' >&3 -read nginxchoice -case $nginxchoice in - 1) PHP_VER=$PHP_53 ;; - 2) PHP_VER=$PHP_54 ;; - *) PHP_VER=$PHP_53 ; -esac - -echo 'Which of the following NginX releases do you want installed:' >&3 -echo "1) Latest Development Release (${NGINX_DEV})(default)" >&3 -echo "2) Latest Stable Release (${NGINX_STABLE})" >&3 -echo -n 'Enter your menu choice [1 or 2]: ' >&3 -read nginxchoice -case $nginxchoice in - 1) NGINX_VER=$NGINX_DEV ;; - 2) NGINX_VER=$NGINX_STABLE ;; - *) NGINX_VER=$NGINX_DEV ; -esac +echo '===============================================================================' >&3 prepare_system - install_mysql - install_php install_apc -if [ $PHP_VER == $PHP_54 ]; then + +if [[ $PHP_VERSION = 5.4* ]]; then tput bold >&3; tput setaf 1 >&3; echo 'At this moment the Suhosin extension is not available for PHP 5.4' >&3; tput sgr0 >&3 else install_suhosin fi -check_php +check_php install_nginx check_nginx - set_paths restart_servers @@ -126,27 +88,32 @@ rm -r $TMPDIR sleep 5 +# Get external IP if possible +wimi="http://automation.whatismyip.com/n09230945.asp" +if curl -s --head ${wimi} | grep "200 OK" > /dev/null + then + EXTIP=$(curl -s ${wimi}) + else + EXTIP=$(hostname -f) +fi + ### Final check if [ -e "/var/run/nginx.pid" ] && [ -e "/var/run/php-fpm.pid" ] ; then - echo '=========================================================================' >&3 + echo '===============================================================================' >&3 echo 'All the components were successfully installed.' >&3 - echo 'If your hosts are setup correctly you should be able to see some stats at:' >&3 - echo "- http://$(hostname -f)/index.php (PHP Status page)" >&3 - echo "- http://$(hostname -f)/apc.php (APC Status page)" >&3 - echo "- http://$(hostname -f)/nginx_status (NginX Status page)" >&3 - echo "- http://$(hostname -f)/status?html (FPM Status page)" >&3 + echo 'You should be able to see some stats when you visit the following URLs:' >&3 + echo "- http://${EXTIP}/index.php (PHP Status page)" >&3 + echo "- http://${EXTIP}/apc.php (APC Status page)" >&3 + echo "- http://${EXTIP}/nginx_status (NginX Status page)" >&3 + echo "- http://${EXTIP}/status?html (FPM Status page)" >&3 tput bold >&3; tput setb 4 >&3; tput setf 7 >&3 echo 'DO NOT FORGET TO SET THE MYSQL ROOT PASSWORD:' >&3; tput smul >&3; echo '"sudo mysqladmin -u root password MYPASSWORD"' >&3 tput sgr0 >&3 - echo 'Press any key to exit...' >&3 - read -n 1 exit 0 else - echo '=========================================================================' >&3 + echo '===============================================================================' >&3 echo 'Errors encountered. Check the install.log.' >&3 - echo 'Press any key to exit...' >&3 - read -n 1 exit 1 fi diff --git a/install_files/apc.sh b/install_files/apc.sh index 1bfc9f0..eebf774 100644 --- a/install_files/apc.sh +++ b/install_files/apc.sh @@ -2,17 +2,17 @@ function install_apc() { # Get APC package - echo "Downloading and extracting APC-${APC_VER}..." >&3 - wget -O ${TMPDIR}/APC-${APC_VER}.tgz "http://pecl.php.net/get/APC-${APC_VER}.tgz" & progress + echo "Downloading and extracting APC-${APC_VERSION}..." >&3 + wget -O ${TMPDIR}/APC-${APC_VERSION}.tgz "http://pecl.php.net/get/APC-${APC_VERSION}.tgz" & progress cd $TMPDIR - tar xzvf APC-${APC_VER}.tgz - check_download "APC" "${TMPDIR}/APC-${APC_VER}.tgz" "${TMPDIR}/APC-${APC_VER}/config.m4" - cd ${TMPDIR}/APC-${APC_VER} + tar xzvf APC-${APC_VERSION}.tgz + check_download "APC" "${TMPDIR}/APC-${APC_VERSION}.tgz" "${TMPDIR}/APC-${APC_VERSION}/config.m4" + cd ${TMPDIR}/APC-${APC_VERSION} # Compile APC source echo 'Configuring APC...' >&3 - ${DSTDIR}/php5/bin/phpize -clean - ./configure --enable-apc --with-php-config=${DSTDIR}/php5/bin/php-config --with-libdir=${DSTDIR}/php5/lib/php & progress + ${DESTINATION_DIR}/php5/bin/phpize -clean + ./configure --enable-apc --with-php-config=${DESTINATION_DIR}/php5/bin/php-config --with-libdir=${DESTINATION_DIR}/php5/lib/php & progress echo 'Compiling APC...' >&3 make -j8 & progress diff --git a/install_files/misc.sh b/install_files/misc.sh index 79661b8..01ab76e 100644 --- a/install_files/misc.sh +++ b/install_files/misc.sh @@ -38,45 +38,39 @@ function check_download () { else echo "Error: ${1} Download was unsuccessful." >&3 echo 'Check the install.log for errors.' >&3 - echo 'Press any key to exit...' >&3 - read -n 1 exit 1 fi } function check_php () { # Check if the PHP executable exists and has the APC and Suhosin modules compiled. - if [ $PHP_VER != $PHP_54 ] && [ -x "${DSTDIR}/php5/bin/php" ] && [ $(${DSTDIR}/php5/bin/php -m | grep apc) ] && [ $(${DSTDIR}/php5/bin/php -m | grep suhosin) ] ; then - echo '=========================================================================' >&3 - echo "PHP ${PHP_VER} with APC and Suhosin was successfully installed." >&3 - ${DSTDIR}/php5/bin/php -v >&3 - echo '=========================================================================' >&3 - elif [ $PHP_VER == $PHP_54 ] && [ -x "${DSTDIR}/php5/bin/php" ] && [ $(${DSTDIR}/php5/bin/php -m | grep apc) ] ; then - echo '=========================================================================' >&3 - echo "PHP ${PHP_VER} with APC was successfully installed." >&3 - ${DSTDIR}/php5/bin/php -v >&3 - echo '=========================================================================' >&3 + if [[ $PHP_VERSION != 5.4* ]] && [ -x "${DESTINATION_DIR}/php5/bin/php" ] && [ $(${DESTINATION_DIR}/php5/bin/php -m | grep apc) ] && [ $(${DESTINATION_DIR}/php5/bin/php -m | grep suhosin) ] ; then + echo '===============================================================================' >&3 + echo "PHP ${PHP_VERSION} with APC and Suhosin was successfully installed." >&3 + ${DESTINATION_DIR}/php5/bin/php -v >&3 + echo '===============================================================================' >&3 + elif [[ $PHP_VERSION = 5.4* ]] && [ -x "${DESTINATION_DIR}/php5/bin/php" ] && [ $(${DESTINATION_DIR}/php5/bin/php -m | grep apc) ] ; then + echo '===============================================================================' >&3 + echo "PHP ${PHP_VERSION} with APC was successfully installed." >&3 + ${DESTINATION_DIR}/php5/bin/php -v >&3 + echo '===============================================================================' >&3 else echo 'Error: PHP installation was unsuccessful.' >&3 echo 'Check the install.log for errors.' >&3 - echo 'Press any key to exit...' >&3 - read -n 1 exit 1 fi } function check_nginx () { # Check if Nginx exists and is executable and display the version. - if [ -x "${DSTDIR}/nginx/sbin/nginx" ] ; then - echo '=========================================================================' >&3 + if [ -x "${DESTINATION_DIR}/nginx/sbin/nginx" ] ; then + echo '===============================================================================' >&3 echo 'NginX was successfully installed.' >&3 - ${DSTDIR}/nginx/sbin/nginx -v >&3 - echo '=========================================================================' >&3 + ${DESTINATION_DIR}/nginx/sbin/nginx -v >&3 + echo '===============================================================================' >&3 else echo 'Error: NginX installation was unsuccessful.' >&3 echo 'Check the install.log for errors.' >&3 - echo 'Press any key to exit...' >&3 - read -n 1 exit 1 fi } @@ -84,9 +78,8 @@ function check_nginx () { function set_paths() { # Make the NginX and PHP paths global. echo 'Setting up paths...' >&3 - export PATH="${PATH}:${DSTDIR}/nginx/sbin:${DSTDIR}/php5/bin:${DSTDIR}/php5/sbin" + export PATH="${PATH}:${DESTINATION_DIR}/nginx/sbin:${DESTINATION_DIR}/php5/bin:${DESTINATION_DIR}/php5/sbin" echo "PATH=\"$PATH\"" > /etc/environment - source /etc/environment } function restart_servers() { @@ -109,6 +102,23 @@ function check_root() { fi } +function check_options() { + # Check the sanity of the options file + # Check if enabled + if [ $ENABLED == 'no' ]; then + echo 'Error: This script is not enabled. To enabled it open the' + echo " OPTIONS file and modify ENABLED='yes'. Also please make sure" + echo ' you check the rest of the file and adjust appropriately.' + exit 1 + fi + + # Check if version numbers are sane + echo $NGINX_VERSION | grep -E -q '^[0-9]+\.[0-9]+\.[0-9]+$' || echo "NginX version number doesn't seem right; Please double check: ${NGINX_VERSION}" + echo $PHP_VERSION | grep -E -q '^[0-9]+\.[0-9]+\.[0-9]+$' || echo "PHP version number doesn't seem right; Please double check: ${PHP_VERSION}" + echo $APC_VERSION | grep -E -q '^[0-9]+\.[0-9]+\.[0-9]+$' || echo "APC version number doesn't seem right; Please double check: ${APC_VERSION}" + echo $SUHOSIN_VERSION | grep -E -q '^[0-9]+\.[0-9]+\.[0-9]+$' || echo "SUHOSIN version number doesn't seem right; Please double check: ${SUHOSIN_VERSION}" +} + function log2file() { # Logging everything to LOG_FILE exec 3>&1 4>&2 diff --git a/install_files/nginx.sh b/install_files/nginx.sh index 145d6e0..f7a2f2f 100644 --- a/install_files/nginx.sh +++ b/install_files/nginx.sh @@ -2,18 +2,18 @@ function install_nginx() { # Create Web Directory - [ ! -d $WEBDIR ] && mkdir $WEBDIR + [ ! -d $WEB_DIR ] && mkdir $WEB_DIR # Get NginX package - echo "Downloading and extracting nginx-${NGINX_VER}..." >&3 - wget -O ${TMPDIR}/nginx-${NGINX_VER}.tar.gz "http://nginx.org/download/nginx-${NGINX_VER}.tar.gz" & progress + echo "Downloading and extracting nginx-${NGINX_VERSION}..." >&3 + wget -O ${TMPDIR}/nginx-${NGINX_VERSION}.tar.gz "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" & progress cd $TMPDIR - tar zxvf nginx-${NGINX_VER}.tar.gz - check_download "NginX" "${TMPDIR}/nginx-${NGINX_VER}.tar.gz" "${TMPDIR}/nginx-${NGINX_VER}/configure" - cd ${TMPDIR}/nginx-${NGINX_VER} + tar zxvf nginx-${NGINX_VERSION}.tar.gz + check_download "NginX" "${TMPDIR}/nginx-${NGINX_VERSION}.tar.gz" "${TMPDIR}/nginx-${NGINX_VERSION}/configure" + cd ${TMPDIR}/nginx-${NGINX_VERSION} # Compile php source echo 'Configuring NginX...' >&3 - ./configure --prefix=${DSTDIR}/nginx \ + ./configure --prefix=${DESTINATION_DIR}/nginx \ --conf-path=/etc/nginx/nginx.conf \ --http-log-path=/var/log/nginx/access.log \ --error-log-path=/var/log/nginx/error.log \ @@ -34,7 +34,7 @@ function install_nginx() { make install # Copy configuration files - sed -i "s~^INSTALL_DIR=.$~INSTALL_DIR=\"${DSTDIR}/nginx\"~" ${SRCDIR}/init_files/nginx + sed -i "s~^INSTALL_DIR=.$~INSTALL_DIR=\"${DESTINATION_DIR}/nginx\"~" ${SRCDIR}/init_files/nginx cp ${SRCDIR}/init_files/nginx /etc/init.d/nginx chmod +x /etc/init.d/nginx update-rc.d -f nginx defaults @@ -43,11 +43,11 @@ function install_nginx() { cp ${SRCDIR}/conf_files/default /etc/nginx/sites-available/default ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default - cp ${SRCDIR}/ext/nxensite ${DSTDIR}/nginx/sbin/nxensite - cp ${SRCDIR}/ext/nxdissite ${DSTDIR}/nginx/sbin/nxdissite - chmod +x ${DSTDIR}/nginx/sbin/* + cp ${SRCDIR}/ext/nxensite ${DESTINATION_DIR}/nginx/sbin/nxensite + cp ${SRCDIR}/ext/nxdissite ${DESTINATION_DIR}/nginx/sbin/nxdissite + chmod +x ${DESTINATION_DIR}/nginx/sbin/* - cp ${SRCDIR}/web_files/* $WEBDIR + cp ${SRCDIR}/web_files/* $WEB_DIR echo -e '\E[47;34m\b\b\b\b'"Done" >&3; tput sgr0 >&3 diff --git a/install_files/php.sh b/install_files/php.sh index c5d38bc..b1871ba 100644 --- a/install_files/php.sh +++ b/install_files/php.sh @@ -9,31 +9,27 @@ function install_php() { apt-get -y install $PHP_LIBRARIES & progress # Get PHP package - echo "Downloading and extracting PHP-${PHP_VER}..." >&3 - wget -O ${TMPDIR}/php-${PHP_VER}.tar.gz "http://us.php.net/distributions/php-${PHP_VER}.tar.gz" & progress + echo "Downloading and extracting PHP-${PHP_VERSION}..." >&3 + wget -O ${TMPDIR}/php-${PHP_VERSION}.tar.gz "http://us.php.net/distributions/php-${PHP_VERSION}.tar.gz" & progress cd $TMPDIR - tar xzvf php-${PHP_VER}.tar.gz - check_download "PHP5" "${TMPDIR}/php-${PHP_VER}.tar.gz" "${TMPDIR}/php-${PHP_VER}/configure" + tar xzvf php-${PHP_VERSION}.tar.gz + check_download "PHP5" "${TMPDIR}/php-${PHP_VERSION}.tar.gz" "${TMPDIR}/php-${PHP_VERSION}/configure" ### Fix Ubuntu 11.04 & 12.10 LIB PATH ### - [ -f /usr/lib/x86_64-linux-gnu/libjpeg.so ] && ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ - [ -f /usr/lib/i386-linux-gnu/libjpeg.so ] && ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/ - [ -f /usr/lib/x86_64-linux-gnu/libpng.so ] && ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/ - [ -f /usr/lib/i386-linux-gnu/libpng.so ] && ln -s /usr/lib/i386-linux-gnu/libpng.so /usr/lib/ - [ -f /usr/lib/x86_64-linux-gnu/libXpm.so ] && ln -s /usr/lib/x86_64-linux-gnu/libXpm.so /usr/lib/ - [ -f /usr/lib/i386-linux-gnu/libXpm.so ] && ln -s /usr/lib/i386-linux-gnu/libXpm.so /usr/lib/ - [ -f /usr/lib/x86_64-linux-gnu/libmysqlclient.so ] && ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/ - [ -f /usr/lib/i386-linux-gnu/libmysqlclient.so ] && ln -s /usr/lib/i386-linux-gnu/libmysqlclient.so /usr/lib/ - [ -d /usr/lib/x86_64-linux-gnu/mit-krb5 ] && ln -s /usr/lib/x86_64-linux-gnu/mit-krb5/lib*.so /usr/lib/ - [ -d /usr/lib/i386-linux-gnu/mit-krb5 ] && ln -s /usr/lib/i386-linux-gnu/mit-krb5/lib*.so /usr/lib/ + arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH) + [ -f /usr/lib/${arch}/libjpeg.so ] && ln -s /usr/lib/${arch}/libjpeg.so /usr/lib/ + [ -f /usr/lib/${arch}/libpng.so ] && ln -s /usr/lib/${arch}/libpng.so /usr/lib/ + [ -f /usr/lib/${arch}/libXpm.so ] && ln -s /usr/lib/${arch}/libXpm.so /usr/lib/ + [ -f /usr/lib/${arch}/libmysqlclient.so ] && ln -s /usr/lib/${arch}/libmysqlclient.so /usr/lib/ + [ -d /usr/lib/i386-linux-gnu/mit-krb5 ] && ln -s /usr/lib/${arch}/mit-krb5/lib*.so /usr/lib/ ################################## # Compile php source - cd ${TMPDIR}/php-${PHP_VER} + cd ${TMPDIR}/php-${PHP_VERSION} ./buildconf --force echo 'Configuring PHP (Please be patient, this will take a while...)' >&3 ./configure \ ---prefix=${DSTDIR}/php5 \ +--prefix=${DESTINATION_DIR}/php5 \ --with-config-file-path=/etc/php5 \ --with-config-file-scan-dir=/etc/php5/conf.d \ --with-curl \ @@ -88,7 +84,7 @@ function install_php() { # Copy configuration files echo 'Setting up PHP...' >&3 - sed -i "s~^INSTALL_DIR=.$~INSTALL_DIR=\"${DSTDIR}/php5\"~" ${SRCDIR}/init_files/php5-fpm + sed -i "s~^INSTALL_DIR=.$~INSTALL_DIR=\"${DESTINATION_DIR}/php5\"~" ${SRCDIR}/init_files/php5-fpm mkdir -p /etc/php5/conf.d /var/log/php5-fpm cp -f php.ini-production /etc/php5/php.ini cp ${SRCDIR}/conf_files/php-fpm.conf /etc/php5/php-fpm.conf diff --git a/install_files/suhosin.sh b/install_files/suhosin.sh index d3a58c4..217de1e 100644 --- a/install_files/suhosin.sh +++ b/install_files/suhosin.sh @@ -2,17 +2,17 @@ function install_suhosin() { #Get Suhosin packages - echo "Downloading and extracting Suhosin-$SUHOSIN_VER..." >&3 - wget -O ${TMPDIR}/suhosin-${SUHOSIN_VER}.tgz "http://download.suhosin.org/suhosin-${SUHOSIN_VER}.tgz" & progress + echo "Downloading and extracting Suhosin-$SUHOSIN_VERSION..." >&3 + wget -O ${TMPDIR}/suhosin-${SUHOSIN_VERSION}.tgz "http://download.suhosin.org/suhosin-${SUHOSIN_VERSION}.tgz" & progress cd $TMPDIR - tar zxvf suhosin-${SUHOSIN_VER}.tgz - check_download "Suhosin" "${TMPDIR}/suhosin-${SUHOSIN_VER}.tgz" "${TMPDIR}/suhosin-${SUHOSIN_VER}/config.m4" - cd ${TMPDIR}/suhosin-${SUHOSIN_VER} + tar zxvf suhosin-${SUHOSIN_VERSION}.tgz + check_download "Suhosin" "${TMPDIR}/suhosin-${SUHOSIN_VERSION}.tgz" "${TMPDIR}/suhosin-${SUHOSIN_VERSION}/config.m4" + cd ${TMPDIR}/suhosin-${SUHOSIN_VERSION} # Compile Suhosin source echo 'Configuring Suhosin...' >&3 - ${DSTDIR}/php5/bin/phpize -clean - ./configure --with-php-config=${DSTDIR}/php5/bin/php-config --with-libdir=${DSTDIR}/php5/lib/php & progress + ${DESTINATION_DIR}/php5/bin/phpize -clean + ./configure --with-php-config=${DESTINATION_DIR}/php5/bin/php-config --with-libdir=${DESTINATION_DIR}/php5/lib/php & progress echo 'Compiling Suhosin...' >&3 make -j8 & progress