nginx 安装

下载
wget https://nginx.org/download/nginx-1.17.6.tar.gz
tar -xvf nginx-1.17.6.tar.gz

yum install -y pcre pcre-devel
yum install -y openssl openssl-devel

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-threads --with-http_v2_module --without-http_access_module

make
make install
useradd www

/usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl enable nginx

--------------------ubuntu------------------------
sudo apt install openssl libssl-dev
sudo apt install libpcre3 libpcre3-dev
sudo apt install zlib1g-dev

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 前因:公司项目用到了淘宝的nginx-http-concat,导致本地PHP跑项目前端页面的js/css无法加载出...
    Alanxx阅读 7,655评论 0 1
  • NGINX安装配置 @(nginx笔记)[nginx] 创建专用组和用户 环境安装准备 没有的话就安装pcre h...
    ahhhhhhhh阅读 4,678评论 0 2
  • 安装过程参考 http://www.nginx.cn/installnginx相关文档 http://www.ng...
    顶儿响叮当阅读 2,425评论 0 0
  • Nginx安装 编译安装 首先安装缺少的依赖包 然后在官网上下载Nginx的安装包 http://nginx.or...
    clickdiff阅读 3,237评论 0 0
  • 坐轮渡近一个小时的路程,我们来到了长岛县,长岛首先是一个岛,其次是烟台市的一个县,莅临渤海和黄海,有一处渤海黄海的...
    sanmaopipi阅读 2,649评论 0 0

友情链接更多精彩内容