Before all used lamp, this configuration a lnmp to see, try Nginx is not easy to use
Turn off SELinux
Vi/etc/selinux/config
#SELINUX =enforcing #注释掉
#SELINUXTYPE =targeted #注释掉
Selinux=disabled #增加
Shutdown-r now #重启系统
Installing Ngnix
Installing the GCC compiler and related tools
Yum-y install gcc gcc-c++ autoconf automake
Libraries that the installation module relies on
Yum-y install zlib zlib-devel OpenSSL openssl–devel pcre pcre-devel
Update system time
Ntpdate time.nist.gov
Enable the on-time service to boot
Chkconfig ntpd on
If you need to compile and install the latest
Get Ngnix version
wget http://nginx.org/download/nginx-1.0.14.tar.gz
Tar zxvf nginx-1.0.14.tar.gz
CD nginx-1.0.14
Direct Yum Installation
Yum install-y Nginx
will be installed in the/usr/share/nginx/
Start Nginx
Service Ngnix Start
Install PHP
Cd/etc/yum.repos.d
wget Http://dev.centos.org/centos/5/CentOS-Testing.repo
Rpm–import http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
Yum install-y php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcryp T Php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm
#启动php-FPM
/ETC/RC.D/INIT.D/PHP-FPM start
Set up auto-start
Chkconfig PHP-FPM on
Configuring Nginx Support PHP
Cp/etc/nginx/nginx.conf/etc/nginx/nginx.confbak
Vi/etc/nginx/nginx.conf
#修改nginx运行账号为: Nginx User of Nginx Group
User Nginx Nginx;
Cp/etc/nginx/conf.d/default.conf/etc/nginx/conf.d/default.confbak
Vi/etc/nginx/conf.d/default.conf
#增加index. php
Index index.php index.html index.htm;
Uncomment the FASTCGI Server section location, and note the parameters of the Fastcgi_param row, change to $document_root$fastcgi_script_name, or use the absolute path
Configure PHP-FPM
Cp/etc/php-fpm.d/www.conf/etc/php-fpm.d/www.confbak
Vi/etc/php-fpm.d/www.conf
#修改用户为nginx
user = Nginx
#修改组为nginx
Group = Nginx
Install MySQL
Yum-y install MySQL Mysql-server
Start MySQL
Service mysqld Start
Chkconfig mysqld on #设为开机启动
Set a password for the root account
Mysql_secure_installation
Restart all services
Service mysqld Restart
Service Nginx Restart
/ETC/RC.D/INIT.D/PHP-FPM restart
Test success
Installing the SSH server and Subversion server
Yum Install-y openssh-server
Yum install-y Subversion
This article is from the "Tibetan Treasure Court" blog, please be sure to keep this source http://xiufm.blog.51cto.com/9921842/1695970
CENTOS6 Server Yum Installation Lnmp (linux+nginx+mysql+php)