Ubuntu快速安装配置lnmp的命令

请逐条执行下面的命令:

/etc/init.d/apache2 stop
apt-get update
apt-get -y remove apache2 apache2.2-common
apt-get -y install php5-cgi php5-fpm php5-gd php5-mysql php5-curl php5-mcrypt php5-common php-apc mysql-server nginx

 

以下命令可以批量执行:

mkdir /var/www
chown www-data:www-data /var/www
sed -i 's/\/usr\/share\/nginx\/www/\/var\/www/' /etc/nginx/sites-available/default
sed -i 's/#\(location.*php\)/\1/' /etc/nginx/sites-available/default 
sed -i 's/#\(.*fastcgi_split_path_info\)/\1/' /etc/nginx/sites-available/default
sed -i 's/#\(.*fastcgi_pass.*9000\)/\1/' /etc/nginx/sites-available/default
sed -i 's/#\(.*fastcgi_index\)/\1/' /etc/nginx/sites-available/default
sed -i 's/#\(.*fastcgi_params\)/\1/' /etc/nginx/sites-available/default
sed -i '/fastcgi_params/{ n; s/#}/}/; }' /etc/nginx/sites-available/default
/etc/init.d/php5-fpm restart
/etc/init.d/nginx restart

 

 

 

文 / admin
LEAVE A REPLY

loading