LNMP architecture built Linux system

First, the firewall status:

1. Check the firewall status:

systemctl status firewalld

service iptables status

firewall-cmd --state

2, permanent and effective on or turn off the firewall:

Open the firewall - chkconfig iptables on

Turn off the firewall - chkconfig iptables off

        systemctl disabled firewalld

3, or temporarily turn off the firewall:

Open the firewall - service iptables start

Turn off the firewall - service iptables stop

       systemctl stop firewalld

4, restart the firewall

systemctl enabled firewalld

service iptables restart

Two, SElinux

  selinux is a security mechanism under linux, when the deployment will be prompted, operation and maintenance personnel like to turn it off. The configuration file / etc / selinux / config of SELINUX = enforcing into SELINUX = disabled. But the disabled modified to take effect after a restart, working time machine could not be restarted. Use getenforce view variables. Variables did not change into Permissive use setenforce 0 operation, Permissive just a warning appears when the deployment, can be considered to avoid the selinux security mechanisms. After the restart will change to selinux disabled.

 

 

 

LNMP architecture:

1, rz tool to upload software packages.

 

 

 

 2, install Nginx Service

yum install -y gcc gcc-c++ make

 

----------------------------------------------------------------------------------------

 rpm is RPM package management tools:

-a queries all packages

-l displays a list of files kit

-i displays information kit

-c list only configuration profiles, with the -l option to use

-s display file status with parameters -l

-R display-related information kit

-q use inquiry mode, when faced with any problem, rpm command will first ask the user.

-----------------------------------------------------------------------------------------

 

 yum install -y pcre-devel zlib-devel openssl-devel

 

 3, to compile install Nginx:

  Detect whether they have 40 Apache service, if installed, uninstall Apache:

rpm -aq httpd

After creating a user program for Nginx Nginx compile installation:

./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-file-aio  --with-http_mp4_module --with-http_ssl_module && make && make install

Modify Nginx configuration file:

Into its own host name:

 

Create a soft link:

ln -s /usr/local/nginx/sbin/* /usr/local/sbin

Modify the system maximum number of open files:

 

 Configuration file syntax test:

 

4, start Nginx service, and is set to boot from the start:

 

 5, test Nginx available:

 

Guess you like

Origin www.cnblogs.com/wqs-Time/p/11432000.html