Linux system: Centos
6.5 x64Nginx version: 1.7.81. Install prce(redirect support ) and openssl (https support, If you don’t need https, you don’t need to install it.
When I installed CentOS 6.5, I selected "Basic Server". By default, these two packages are not installed, so just run and install them. - 2. Download nginx 1.7.8
wget http:
/- /nginx.org
/
download/nginx-
1.
7
. 8
.
tar
.- gz3. Unzip, compile and install tar -zxvf nginx-1.7. 8.tar. gz
Then enter the directory to compile and install
- cd nginx-1.7.8
.
/configure
-
-- prefix=/usr/local/nginx
-
1.
5
.- 1
--with-http_ssl_module --with-http_spdy_module
--with-http_stub_status_module --with-pcre
- If there is no error message, you can perform the following installation: make
make install-
4. Start the nginx process
/usr/
local
/nginx
-
1
.- 7.
8/sbin/nginx
-
Restart or shut down Process:
/usr/- local/nginx-1.7.8/sbin/nginx -s
reload
/usr/
local/
nginx
-- 1.7.8/sbin/nginx -s
stop5. Turn off the firewall, or add firewall rules to test.
service iptables stop-
or edit the configuration file: vi /etc/sysconfig/iptables
Add such a rule to open port 80 and save it :
-
-A INPUT
-
m state -
-
state
NEW
-
m tcp - -p tcp -
-dport
80
-j ACCEPT
- Restart the service: service iptables restartok, you can access it through the browser. Welcome to nginx!
The above introduces the CentOS 65 installation Nginx 178 tutorial, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.