1.安装nginx
1.下载安装资源
$ wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2.安装软件
$ rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
*安装过程会提示错误可以不必理会(warning: nginx-release-centos-6-0.el6.ngx.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY)
$ yum install nginx
3.安装完成
nginx默认目录
1 配置所在目录:/etc/nginx/
2 PID目录:/var/run/nginx.pid
3 错误日志:/var/log/nginx/error.log
4 访问日志:/var/log/nginx/access.log
5 默认站点目录:/usr/share/nginx/html
2.安装php
1.根据自己需要安装php包
$ yum install php php-fpm php-mysql php-cli php-gd php-cgi ...
2.配置nginx识别php
$ sudo vim /etc/nginx/conf
如图
在根目录配置phpinfo.php可显示php的详细信息
4.安装mysql
$ sudo yum mysql-sever mysql mysql-devel
启动mysql
$ sudo service mysqld start
连接mysql
$ mysql -p -u root
默认root的密码是空
设置mysql root账户密码
$ mysqladmin -u root -p password "test123"**