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
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
以上就是Nginx安装实例分析的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号