nginx+php+mysql在debian下安装脚本尝试

测试是在virtualbox下的虚拟机中的,先使用virtualbox中的备份虚拟机的状态,脚本重新测试可以使用这个备份恢复到安装前的状态

apt-get update

apt-get install -y nginx
apt-get install -y mysql-server
apt-get install -y php5
apt-get install -y php5-mysql
apt-get install -y php5-cli
apt-get install -y php5-common
apt-get install -y php5-suhosin

ee=`grep “deb http://php53.dotdeb.org” /etc/apt/sources.list`
if [ -z “$ee” ] ; then
echo “deb http://php53.dotdeb.org stable all” >> /etc/apt/sources.list
fi

apt-get update
#apt-get install -y php5-fpm
apt-get install php5-fpm

file=”/etc/nginx/sites-available/default”
filebk=”/etc/nginx/sites-available/default.bak”
newfile=”/root/nginx.default”

if [ -f “$file” ] ; then
sed “46,52s/includefastcgi_params/include fastcgi_params/” $file|sed “46,52s/\/scripts\$fastcgi_script_name/\/var\/www\/nginx-default\$fastcgi_script_name/”|sed “46,52s/#//” > $newfile
cp $file $filebk
rm $file
cp $newfile $file
echo “ok”
else
echo “no file”
fi

主要是为了练习bash shell语言练手的,当然也为了方便安装,当然没那个lnmp安装脚本完善,有时间慢慢完善,lnmp脚本可以拿来参考!

apt-get install -y php5-fpm这句在安装中怎样都不起作用,始终要手动.

这个脚本只是安装好最基本的,其它还是手动的!

安装后请重启主机啊!

关于无聊人

一个无聊人而已
此条目发表在Linux分类目录。将固定链接加入收藏夹。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注