Create Web Site Base On CentOS PHP Nginx Mysql
安装nginx rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum info nginx #查看yum的nginx信息
yum install nginx #安装nginx
service nginx start #启动nginx
安装其他程序
1 | yum check-update |
添加nginx 默认主页index.php
vim /etc/nginx/conf.d/default.conf
1 | location / { |
配置nginx支持php
vim /etc/nginx/conf.d/default.conf
1 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
配置php-fpm
vim /etc/php-fpm.d/www.conf
1 | ; Unix user/group of processes |
chkconfig php-fpm on #设置php-fpm自启动
chkconfig mysqld on #设置mysqld自启动
service nginx restart #重新启动nginx
service php-fpm start #启动php-fpm
service mysqld start #启动mysqld
Open port 80 cd /etc/sysconfig system-config-firewall
Or
Add code in iptables -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT