5分钟搞定Nginx安装的教程
1. 安装gcc(centos 7之后一般已自带,可以在第6步失败后再安装)
yum install gcc gcc-c++
2. 安装pcre
yum install -y pcre pcre-devel
3. 安装zlib
yum install -y zlib zlib-devel
4. 安装openssl
yum install -y openssl openssl-devel
5. 下载并解压Nginx(之后进入Nginx目录)
wget http://nginx.org/download/nginx-1.12.2.tar.gz
6. 编译Nginx(加载常用模块如ssl)
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module
7. 安装Nginx
make && make install
8. 启动
/usr/local/nginx/sbin/nginx
9. 停止
/usr/local/nginx/sbin/nginx -s stop(reload表示重启)
10. 浏览器访问Nginx所在机器IP,验证Nginx启动成功
http://yourhost/
注:Nginx配置文件位置
/usr/local/nginx/conf/nginx.conf
相关推荐
张立军的架构之路 2020-09-28
yongzhang 2020-07-19
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09