Nginx教程

xiaoxiao2021-02-27  213

配置实用Nginx步骤: 1:http://nginx.org/en/download.html 下载nginx giz 2:解压 3:dos进去目录 nginx.exe打开 4:配置host C:\Windows\System32\drivers\etc 编辑host,在最底下进行配置 127.0.0.1 你配置的域名 5:测试 网页输入你的域名

虚拟机配置Nginx

开机自起

!/bin/bash

nginx Startup script for the Nginx HTTP Server

it is v.0.0.2 version.

chkconfig: - 85 15

description: Nginx is a high-performance web and proxy server.

It has a lot of features, but it’s not for everyone.

processname: nginx

pidfile: /var/run/nginx.pid

config: /usr/local/nginx/conf/nginx.conf

nginxd=/usr/local/nginx/sbin/nginx nginx_config=/usr/local/nginx/conf/nginx.conf nginx_pid=/var/run/nginx.pid RETVAL=0 prog=”nginx”

Source function library.

. /etc/rc.d/init.d/functions

Source networking configuration.

. /etc/sysconfig/network

Check that networking is up.

[ {NETWORKING} = “no” ] && exit 0  [ -xnginxd ] || exit 0

Start nginx daemons functions.

start() { if [ -e nginxpid];thenechonginxalreadyrunning.exit1fiechon "Starting prog:daemon nginxd -c nginxconfigRETVAL= ? echo [ RETVAL = 0 ] && touch /var/lock/subsys/nginx     returnRETVAL }

Stop nginx daemons functions.

stop() { echo -n "Stopping prog: ” killproc nginxdRETVAL= ? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid }

reload nginx service functions.

reload() { echo -n "Reloading prog: ” #kill -HUP cat ${nginx_pid} killproc nginxdHUPRETVAL= ? echo }

See how we were called.

case “ 1instart)start;;stop)stop;;reload)reload;;restart)stopstart;;status)status prog RETVAL= ?;;)echo "Usage: progstart|stop|restart|reload|status|helpexit1esacexit RETVAL

转载请注明原文地址: https://www.6miu.com/read-12556.html

最新回复(0)