本机环境:服务器是阿里云ECS;使用的镜像是:公共镜像 CENTOS 7.2 一.nginx安装
1.下载对应当前系统版本的nginx包(package)
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2.建立nginx的yum仓库(默认yum是没有nginx的)
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
3.下载并安装nginx
yum install nginx
4.nginx启动(nginx安装目录下-/usr/sbin/)
systemctl start nginx.service
ps:一些其它nginx相关命令:
nginx相关配置文件:
默认的配置文件在 /etc/nginx 路径下,使用该配置已经可以正确地运行nginx;
如需要自定义,修改其下的 nginx.conf 等文件即可;
在浏览器地址栏中输入部署nginx环境的机器的IP,如果一切正常,应该能看到如下字样的内容。
Welcome to nginx!
If you see this page, the nginx web server is successfully installed andworking. Further configuration is required.
For online documentation and support please refer tonginx.org.Commercial support is available atnginx.com.
Thank you for using nginx. 第二步:MYSQL安装