CentOS6 快速搭建LNMP环境
- rpm -ivh http://7fvdgt.com1.z0.glb.clouddn.com/rpms/nginx-release-centos-6-0.el6.ngx.noarch.rpm
- rpm -ivh http://7fvdgt.com1.z0.glb.clouddn.com/rpms/epel-release-6-8.noarch.rpm
- rpm -ivh http://7fvdgt.com1.z0.glb.clouddn.com/rpms/remi-release-6.rpm
- /etc/yum.repos.d/remi.repo
- yum -y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear
- /etc/php-fpm.conf 用户组为nginx
chown -R nginx:nginx /var/lib/php/session(不存在则需要创建) chown -R nginx:nginx /var/www/(web目录) chmod -R 775 /var/www/ (同组可修改权限,方便配置ftp,ftp应该加入到nginx组,如果需要更高的安全设置,则不应当将只读的目录赋予nginx,php组可写权限) service nginx start(start|stop|restart|reload) service php-fpm start(start|stop|restart) service mysqld start(start|stop|restart|reload) 设置自启动 chkconfig nginx on chkconfig php-fpm on chkconfig mysqld on
pureftpd useradd -g nginx -d /var/www -s /sbin/nologin UnixAuthentication yes service pure-ftpd start