Installation steps:first, prepare the relevant source packages and packages, such asAll packages are in the/SRC directory of the cloud server.
Second, installation1. Installing Nginx server, support VOD Stream, FILEUPLOADCD/SRC
Tar zxvf pcre-8.36.tar.gz
CD pcre-8.36
////pcre is a very small regular expression library, small and powerful../configure--prefix=/usr/local/pcre
Make && make install
Cd..
Tar zxvf openssl-1.0.1j.tar.gz
Groupadd www
Useradd-g www www-s/bin/false
Unzip Nginx-upload-module-2.2.zip
Unzip Nginx-upload-progress-module-master.zip
Tar zxvf zlib-1.2.8.tar.gz
Tar zxvf nginx-1.6.2.tar.gz
CD nginx-1.6.2
./configure--prefix=/usr/local/nginx--without-http_memcached_module--user=www--group=www--with-http_ssl_module --with-http_stub_status_module--with-http_gzip_static_module--with-http_mp4_module--with-http_flv_module-- with-openssl=/src/openssl-1.0.1j--with-pcre=/src/pcre-8.36--with-zlib=/src/zlib-1.2.8--add-module=/src/ Nginx-upload-progress-module-master--add-module=/src/nginx-upload-module-2.2
Make && make install
Vi/etc/rc.d/init.d/nginx #编辑启动文件添加下面内容 (Blue All)
#!/bin/bash # nginx Startup script for the Nginx HTTP Server # It is v.0.0.2 version. # Chkconfig:- about # 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=/usr/local/nginx/logs/nginx.pid retval=0 prog= "Nginx" # Source function library. ./etc/rc.d/init.d/functions # Source Networking configuration. ./etc/sysconfig/network # Check that networking are up. [${networking} = "No"] && exit 0 [-x $nginxd] | | exit 0 # Start Nginx daemons functions. start () { if [-e $nginx _pid];then echo "Nginx already running ..." Exit 1 fi echo-n $ "Starting $prog:" Daemon $nginxd-C ${nginx_config} retval=$? Echo [$RETVAL = 0] && touch/var/lock/subsys/nginx return $RETVAL } # Stop Nginx daemons functions. Stop () { echo-n $ "Stopping $prog:" Killproc $nginxd retval=$? Echo [$RETVAL = 0] && rm-f/var/lock/subsys/nginx/usr/local/nginx/logs/nginx.pid } Reload () { echo-n $ "reloading $prog:" #kill-hup ' cat ${nginx_pid} ' Killproc $nginxd-hup retval=$? Echo } # See how we were called. Case "$" in start) Start ;; stop) Stop ;; Reload) Reload ;; restart) Stop Start ;; status) Status $prog retval=$? ;; *) echo $ "Usage: $prog {start|stop|restart|reload|status|help}" Exit 1 Esac Exit $RETVAL
Save!!
chmod 775/etc/rc.d/init.d/nginx #赋予文件执行权限
Chkconfig Nginx on #设置开机启动
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Nginx Service Idiot Building