Configure the firewall first
CentOS 7.0 defaults to using firewall as the firewall
1. Close the firewall:
#停止firewall #禁止firewall开机启动
2. Turn off SELinux
#使配置立即生效
LNMP Installation
1. Installing Nginx
http://nginx.org/packages/centos/7/noarch/rpms/nginx-release-centos-7-0.el7.ngx.noarch.rpm RPM- IVH nginx-Release-centos-7install Nginx
2. Start Nginx
#设置开机启动
3. Change the Nginx port number (depending on your needs)
#重启nginx
4. Visit http://ip:81 to see Nginx homepage
5. Next Installation PHP-FPM
Enable Php-fpm.service #设置开机启动
6. Change the Nginx configuration file to recognize PHP vi/etc/nginx/conf.d/default.conf, the previous # to remove it, you can change the Fastcgi_param
~ \.php$ { root html; Fastcgi_pass 127.0.0.1:9000; fastcgi_param script_filename/usr/share/nginx/html/include Fastcgi_params;}
7. Visit test.php
123; ?> visit http://ip:81/test.php to see the PHP page in Nginx
8. Load Configuration
Enter vi/etc/nginx/conf.d/default.conf
Upstream site{ 172.16.170.138; 172.16.170.139; } proxy_pass http://necodon.cc;}
9. Change the domain name above (necodon.cc) site,localhost to Www.a.com
Lamp installation
1. Installing Apache
#根据提示, enter the y installation to successfully install #启动apache #停止apache #重启apache #设置apache开机启动
2. Install mariadb (MySQL)
#询问是否要安装, enter Y to install automatically until the installation is complete #启动MariaDB #停止MariaDB #重启MariaDB #设置开机启动
3. Modify the MySQL password, the default is empty after installation
Modify MySQL Password: Set password for ' root ' @ ' localhost ' =password ' root ';
MySQL Authorized remote connection (NAVICAT, etc.): Grant all on *. * to root identified by ' root ';
4. Install PHP and components to enable PHP support MariaDB
#重启apache
5. Access Testing
CD/<?php phpinfo (); #保存退出
In the client browser enter the server IP address, you can see the configuration information as shown in the relevant!
Centos7.0 's LNMP and lamp