标签:open c++ index service off time types profile with
yum install gcc gcc-c++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel
tar xf nginx-1.18.0.tar.gz -C /data/
useradd www -s /sbin/nologin/ -M
./configure --prefix=/data/nginx-1.18.0 --user=www --group=www --with-http_ssl_module --with-http_stub_status_module
make && make install
ln -s /data/nginx-1.18.0 /data/nginx
grep -Ev "#|^$" nginx.conf.default >nginx.conf
cat /etc/profile.d/nginx.sh
PATH=$PATH:/data/nginx/bin/:/data/nginx/sbin
source /etc/profile
cat <<EOF> /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/data/nginx/sbin/nginx
ExecReload=/data/nginx/sbin/nginx -s reload
ExecStop=/data/nginx/sbin/nginx -s quit
PrivateTmp=true
#EnvironmentFile=/etc/sysconfig/rdisc
#ExecStart=/sbin/rdisc $RDISCOPTS
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
配置虚拟主机
vim /data/nginx/conf/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type data/octet-stream;
sendfile on;
server_tokens off;
keepalive_timeout 65;
server {
listen 80;
server_name ;
location / {
root html;
index ;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
systemctl restart nginx
systemctl stop nginx
systemctl restart nginx
标签:open c++ index service off time types profile with
原文地址:https://www.cnblogs.com/zongliang-ya/p/14520842.html