//是否安装
which nginx
//查看源
yum list nginx
//谷歌 nginx yum
//切换到root账户
su
//新建配置文件
vi /etc/yum.repos.d/nginx.repo
//文件内容
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
yum list nginx
//安装
yum install nginx
//查看进程
ps -ef |grep nginx
//启动脚本
/etc/init.d/nginx start
//访问127.0.0.1
//安装php
yum install php php-fpm
//php配置文件
vi /etc/rc.d/php-fpm.d/www.conf
;listen 127.0.0.1:9000
//启动php
/etc/rc.d/init.d/php-fpm start
//修改ng配置文件
/etc/nginx/conf.d/default.conf
查找php 去掉;
改root:
/usr/share/nginx/html
改fastcgi_param:SCRIPT_FILENAME $document_root$fastcgi_script_name
//重启ng
/etc/init.d/nginx restart
index.php
vi /usr/share/nginx/html/index.php
<? phpinfo();
//安装mysql
yum install mysql mysql-server
//mysql初始化
mysql_install_db
//启动服务
mysqld_safe &
//连接
mysql -uroot
show databases
//连接php和mysql
yum list php-mysql
yum install php-mysql
//重启
/etc/init.d/php-fpm restart
//test.php
vi /usr/share/nginx/html/test.php
关闭防火墙
/etc/init.d/iptables stop
来源:https://www.cnblogs.com/toalaska/p/3999506.html