CentOS 7 yum 安装 Nginx
来源:互联网 发布:豆腐软件 编辑:程序博客网 时间:2024/05/18 00:42
1.添加Nginx到YUM源
添加CentOS 7 Nginx yum资源库,打开终端,使用以下命令:
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2.安装Nginx
在你的CentOS 7 服务器中使用yum命令从Nginx源服务器中获取来安装Nginx:sudo yum install -y nginxNginx将完成安装在你的CentOS 7 服务器中。
3.启动Nginx
刚安装的Nginx不会自行启动。运行Nginx:sudo systemctl start nginx.service如果一切进展顺利的话,现在你可以通过你的域名或IP来访问你的Web页面来预览一下Nginx的默认页面;
如果看到这个页面,那么说明你的CentOS 7 中 web服务器已经正确安装。
CentOS 7 开机启动Nginx
sudo systemctl enable nginx.service更多systemctl命令可查看《systemctl命令用法》
Nginx配置信息
网站文件存放默认目录/usr/share/nginx/html网站默认站点配置
/etc/nginx/conf.d/default.conf自定义Nginx站点配置文件存放目录
/etc/nginx/conf.d/Nginx全局配置
/etc/nginx/nginx.confNginx启动
nginx -c nginx.conf在这里你可以改变设置用户运行Nginx守护程序进程一样,和工作进程的数量得到了Nginx正在运行,等等。
Linux查看公网IP
您可以运行以下命令来显示你的服务器的公共IP地址:ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
转载地址:http://blog.csdn.net/u012486840/article/details/52610320
阅读全文
0 0
- CentOS 7 YUM 安装 Nginx
- CentOS 7 yum 安装 Nginx
- centos 7 yum 安装 NGINX
- centos 7 yum安装 nginx
- CentOS 7 yum 安装 Nginx
- CentOS 7 yum 安装 Nginx
- CentOS 7 yum 安装 Nginx
- CentOS 7 yum 安装 Nginx
- CentOS 7 YUM 安装 Nginx
- CentOS 7 yum 安装 Nginx
- CentOS 7 yum 安装 Nginx
- CentOS 7 YUM 安装 Nginx
- centos yum安装nginx
- CentOS yum 安装 nginx
- Centos yum 安装Nginx
- CentOS yum安装nginx
- CentOS 7 yum安装nginx-1.12.0
- CentOS 7下 yum方式安装Nginx
- UVA 548
- Java Arrays.asList注意事项
- UVA 297
- 【笔记】Python学习笔记 ——1
- PHP加密方法
- CentOS 7 yum 安装 Nginx
- 二、Elastic5.5.2安装中文分词器教程及简单测试
- UVA 712
- 自写过滤器替代ValidateAntiForgeryToken解决asp.net mvc关于提供的防伪标记适用于其他基于声明的用户,而不适用于当前用户的错误
- 科研助手
- [hdu-1512]Monkey King 题解
- 篇启
- Java里一些容易混淆的概念
- 图片和Canvas的相互转换