Nginx教程

来源:互联网 发布:fifa online3 cdk淘宝 编辑:程序博客网 时间:2024/06/04 20:13

配置实用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  
[ -x
nginxd ] || exit 0

Start nginx daemons functions.

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

Stop nginx daemons functions.

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

reload nginx service functions.

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

See how we were called.

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

原创粉丝点击