车栈

CentOS6 快速搭建LNMP环境

  1. rpm -ivh http://7fvdgt.com1.z0.glb.clouddn.com/rpms/nginx-release-centos-6-0.el6.ngx.noarch.rpm
  2. rpm -ivh http://7fvdgt.com1.z0.glb.clouddn.com/rpms/epel-release-6-8.noarch.rpm
  3. rpm -ivh http://7fvdgt.com1.z0.glb.clouddn.com/rpms/remi-release-6.rpm
  4. /etc/yum.repos.d/remi.repo
  5. 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
  6. /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