In the recent period, I’ve been tossing Nginx. First, all kinds of vps need to be loaded with webserver, and then I’m going to fight against it. Previously, I used the military brother's LNMP one-click installation package, without tangling various configurations. But recently I only needed Nginx one thing, and PHP
and MySQL have a particularly long installation time and space, so I decided to make a Nginx one-click installation script myself. The installation of Nginx is still quite simple, and the dependencies can basically be solved by the yum source. The only thing that is not there is PCRE. This is just a direct download from the official website.
This script is basically extracted from the LNMP one-click installation script. The default configuration file is also used inside. I just simplified the steps and modified the configuration file. Nginx runs by default with nobody privileges.
The script is tested in Alibaba Cloud and Linode Centos, and it still has some versatility.
Download: nginx.sh
#!/bin/bashPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr /local/sbin:~/binexport PATH#Install dependency environment yum install -y patch openssl make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10- Devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl Openssl-devel vim-minimal nano fonts-chinese gettext gettext-devel ncurses-devel gmp-devel pspell-devel unzip libcap diffutils# install PCREwget http://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36 .tar.gztar zxf pcre-8.36.tar.gzcd pcre-8.36/./configure && make && make installcd ../#install NGINXwget http://nginx.org/download/nginx-1.6. 2.tar.gztar zxf nginx-1.6.2.tar.gzcd nginx-1.6.2/./configure -- User=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-http_spdy_modulemake & & make installcd ../
ln -s /usr/local/lib/libpcre.so.1 /libln -s /usr/local/nginx/sbin/nginx /usr/bin/nginxrm -f /usr/local/nginx/conf/nginx.confmkdir -p /home/wwwroot/defaultchmod +w /home/wwwroot/defaultmkdir -p /home/wwwlogschmod 777 /home/wwwlogschown -R nobody:nobody /home/wwwroot/default
wget -c http://soft.vpser.net/lnmp/ext/init.d.nginxcp init.d.nginx /etc/init.d/nginxchmod +x /etc/init.d/Nginxchkconfig --level 345 nginx on/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT/sbin/iptables-saveldconfigwget -c http://hack0nair.me/Download/nginx.confmv nginx.conf /usr /local/nginx/conf//etc/init.d/nginx start
Find the virtual machine settings, set as shown below (additional figure: must be 3.0 u disk and pl
DNS (Domain Name System), a distributed database on the Internet that maps domain names and IP addr
In the various Linux distributions now, the enterprise version of red hat is relatively safe. For t
For Linux systems, whether it is a central processor, memory, disk drive, keyboard
Fedora Features - Smolt solves hardware compatibility problems
Df and du commands using basic tutorials
8 tips to make you a super Linux end user
Linux batch delete file and empty file delete command
How to use the capability feature to enhance the security of Linux systems
Win 7 World of Warcraft can not full screen solution
Windows Tips: How to make the computer "automatically on time"
How to set win8 gesture operation win8 gesture operation setting picture culture teach
Win10 system notification area battery icon is missing recovery method
CF7 Anniversary Theme Song Released Gifts Non-stop Event Website Sharing
How to completely solve the problem of Vista mad read hard disk
Win7 system boot error prompt Runtime Error wmpnscfg.exe how to do?
Modify the attachments and twists and turns. How is my Foxmail