各个版本,安装过程大差不差,所以记录下nginx的安装记录。
Nginx开源版
Nginx plus 商业版
openresty
Tengine
yum install -y gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
mkdir /usr/local/nginx
./configure --prefix=/usr/local/nginx
make
make install
进入安装目录
cd /usr/local/nginx
[root@bogon nginx]# pwd
/usr/local/nginx
[root@bogon nginx]# ll
总用量 4
drwx------. 2 nobody root 6 4月 7 09:41 client_body_temp
drwxr-xr-x. 2 root root 4096 4月 7 09:39 conf
drwx------. 2 nobody root 6 4月 7 09:41 fastcgi_temp
drwxr-xr-x. 2 root root 40 4月 7 09:39 html
drwxr-xr-x. 2 root root 58 4月 7 09:47 logs
drwx------. 2 nobody root 6 4月 7 09:41 proxy_temp
drwxr-xr-x. 2 root root 19 4月 7 09:39 sbin
drwx------. 2 nobody root 6 4月 7 09:41 scgi_temp
drwx------. 2 nobody root 6 4月 7 09:41 uwsgi_temp
[root@bogon nginx]#
systemctl stop firewalld.service
systemctl disable firewalld.service
vi /usr/lib/systemd/system/nginx.service
服务脚本内容
[Unit]
Description=nginx - web server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
ExecQuit=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start nginx.service
systemctl stop nginx.service
systemctl status nginx.service
systemctl enable nginx.service
yum install -y gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
mkdir /usr/local/nginx
./configure --prefix=/usr/local/nginx
make
make install
cd /usr/local/nginx
pwd
腾云先锋(TDP,Tencent Cloud Developer Pioneer)是腾讯云GTS官方组建并运营的技术开发者群体。这里有最专业的开发者&客户,能与产品人员亲密接触,专有的问题&需求反馈渠道,有一群志同道合的兄弟姐妹。来加入属于我们开发者的社群吧!
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。