标签:pen emctl base lte pes nginx har efi firewall
#!/bin/bash$i
#into /root && download soft php
php_install(){
cd $HOME
yum install -y libxml2 libxml2-devel
if [ ! -f php-5.6.28.tar.bz2 ]; then
wget http://mirrors.sohu.com/php/php-5.6.28.tar.bz2
tar jxf php-5.6.28.tar.bz2
cd php-5.6.28
./configure --prefix=/usr/local/php56 --with-config-file-path=/usr/local/php56/etc --with-mysql=/usr/local/mysql55 --enable-fpm
make ; make install
systemctl restart php-fpm
netstat -tnlp | grep php
else
echo -e "\033[31mSorry,php-5.6.28.tar.bz2 already install .exiting....\033[0m"
exit 2
fi
}
$i
lnpm_install(){
cd php-5.6.28
if [ ! -f /usr/local/php56/etc/php.ini -a /usr/local/php56/etc/php-fpm.conf -a /etc/init.d/php-fpm ]; then
#copy initialization file to master program
cp php.ini-development /usr/local/php56/etc/php.ini
#copy and chenge master default of configure
cp /usr/local/php56/etc/php-fpm.conf.default /usr/local/php56/etc/php-fpm.conf
#make startup script
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
#change its permission
chmod o+x /etc/init.d/php-fpm
#startup php-fpm && check its port
/etc/init.d/php-fpm start
netstat -tnlp | grep php-fpm
echo "
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
}
}
}" >/usr/local/nginx/conf/nginx.conf
echo "
<?php
phpinfo();
?>">/usr/local/nginx/html/index.php
/usr/local/nginx/sbin/nginx -s reload
curl 172.0.0.1/index.php
else
echo -e "\033[31mSorry,php-fpm already exist,exiting.....\033[0m"
exit 3
fi
}
$i
PS3="Please enter your select install menu:"
select i in auto_install_nginx auto_install_mysql auto_install_php auto_integrate_lnmp
do
case $i in
auto_install_nginx)
nginx_install
;;
auto_install_mysql)
mysql_install
;;
auto_install_php)
php_install
;;
auto_integrate_lnmp)
lnpm_install
exit
esac
done
标签:pen emctl base lte pes nginx har efi firewall
原文地址:https://blog.51cto.com/13689591/2451980