Before installing Nginx in Linux and simply managing Nginx, you need to prepare the following packages: 1. perl library: pcre-7.9.tar.gz2.Nginx installation package: nginx-0.8.15.tar.gz your Linux has installed gcc and so on, if not, first install yum, compile what... before installing Nginx in Linux and simply managing Nginx, you need to prepare the following packages: 1. perl library: pcre-7.9.tar.gz2. nginx installation package: nginx-0.8.15.tar.gz whether your Linux has installed gcc and so on, if not, first install yum, compile what need to rely on these: [plain] yum install gcc-c ++ gcc-g77 autoconf automake zlib * fiex * libxml * ncurses-devel libmcrypt * libtool-ltdl-devel * libevent install pcre package [plain] sudo tar -zvxf pcre-7.9.tar.gz cd pcre-7.9 www.2cto.com sudo. /configure -- prefix =/usr/local/web/lib/pcre sudo make install Nginx package, installation Path/usr/local/web/nginx.0.8.15 [plain] sudo tar zxvf nginx-0.8.15.tar.gz cd nginx-0.8.15 sudo. /configure -- user = nfsnobody -- group = nfsnobody -- prefix =/usr/local/web/nginx.0.8.15 -- with-http_stub_status_module -- without-http-cache sudo make install create log Directory, www Directory: [plain] sudo mkdir-p/usr/local/web/nginx.0.8.15/logs # log folder sudo chmod + w/usr/local/web/nginx.0.8.15/logs sudo chown-R nfsnobody: nfsnobody/usr/local/web/nginx.0.8.15/logs sudo mkdir/usr/local/web/www # log folder sudo chown-R nfsnobody: nfsnobody/usr/local/web/www copy the configuration file we have prepared, [plain] sudo rm-f/usr/local/web/nginx.0.8.15/conf/nginx. conf sudo cp nginx. conf/usr/local/web/nginx.0.8.15/conf/nginx. conf # configuration file sudo cp fcgi. conf/usr/local/web/nginx.0.8.15/conf/fcgi. start Nginx www.2cto.com [plain] sudo/usr/local/web/nginx.0.8.15/sbin/nginx in conf to check whether Nginx is started. check Nginx process and access it in the browser using ip address: [plain] ps-ef | grep nginx if the firewall has been enabled, add port 80 to the firewall: [plain] iptables-I INPUT-p tcp -- dport 80-j ACCEPT service iptables save service restart Nginx management: [plain] # default Startup mode: sudo/usr/local/web/nginx.0.8.15/sbin/nginx sudo/usr/local/web/nginx.0.8.15/sbin/nginx-s stop sudo/usr/ local/web/nginx.0.8.15/sbin/nginx-s reload www.2cto.com # bring the configuration file: sudo/usr/local/web/nginx.0.8.15/sbin/nginx-c/usr/local/web/nginx.0.8.15/conf/nginx. conf # Startup method with test configuration file sudo/usr/local/web/nginx.0.8.15/sbin/nginx-t # Stop sudo kill-QUIT 'cat/usr/local/web/nginx.0.8.15 /nginx. pid '# quickly stop sudo kill-INT 'cat/usr/local/web/nginx.0.8.15/nginx. pid '# restart sudo kill-HUP 'cat/usr/local/web/nginx.0.8.15/nginx smoothly. pid 'author initphp
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service