yum build lnmp environment (CentOS6.3)

In CentOS6.3 through practice.

1. Turn off the firewall

[root @ CentOS ~] # chkconfig iptables OFF


2. Close SELinux
vi / etc / sysconfig / SELinux 
// will SELINUX = enforcing amended as disabled and then reboot to take effect


3, third-party yum configuration CentOS 6.0 source (CentOS default there are no standard source nginx package)
[root @ CentOS ~] # yum install wget
// wget download tool
[root @ CentOS ~] # wget http://www.atomicorp.com/installers/atomic
// download source atomic yum
[root @ CentOS ~] # sh ./atomic
output yes // when prompted mounting
[the CentOS the root @ ~] # yum update Check-
// update packages yum


4. install development and libraries
[root @ CentOS ~] # yum -y the make-NTP OpenSSL OpenSSL the install PCRE PCRE devel-devel the libpng 
the libpng-devel libjpeg libjpeg-devel-6B-6B FreeType FreeType devel-Gd Gd-devel zlib zlib-devel 
GCC GCC-C ++ libXpm libXpm-devel the ncurses the ncurses-devel libmcrypt libmcrypt-devel the libxml2 
the libxml2-devel the imake autoconf automake Screen the sysstat compat-libstdc ++ - 33 is curl curl-devel


5. The uninstall the installed Apache, MySQL, PHP
[the root @ the CentOS ~ ] # yum Remove the httpd
[the CentOS the root @ ~] # yum Remove MySQL
[the CentOS the root @ ~] # yum Remove PHP


6. The mounting Nginx
[the CentOS the root @ ~] # yum the install Nginx
[the CentOS the root @ ~] # Nginx Start-Service
[ @ ~ the CentOS the root] # 235 --levels the chkconfig Nginx ON
// disposed 2,3,5-level boot


7. install MySQL
[the CentOS the root @ ~] # yum the install MySQL MySQL MySQL-Server-devel
[the CentOS the root @ ~] Service Start mysqld #
[root @ CentOS ~] # chkconfig mysqld 235 --levels ON
[the CentOS root @ ~] # mysqladmin -u root password "123456"
// set a password for root
[the CentOS root @ ~] # mysqld the restart-Service
// restart MySQL


8. The mounting PHP
[the CentOS root @ ~] # yum the install PHP PHP-CLI-FastCGI lighttpd PHP-PHP-MySQL Gd-IMAP PHP-PHP LDAP 
PHP-PHP-PEAR ODBC-XML PHP-PHP-PHP the xmlrpc the mbstring the mcrypt PHP-PHP-PHP MSSQL SNMP PHP-SOAP- 
PHP-Tidy PHP- php php-devel-Common FPM
// make the required components and installation php PHP support MySQL, FastCGI mode
[the CentOS the root @ ~] # FPM-Start-Service php
[the CentOS the root @ ~] # 235 php the chkconfig --levels FPM-ON


9. configure nginx support PHP
[the CentOS the root @ ~] # Music Videos /etc/nginx/nginx.conf /etc/nginx/nginx.confbak
// configuration file to the backup file
[root @ CentOS ~] # cp / etc / nginx / nginx.conf.default /etc/nginx/nginx.conf
// Since the original configuration file to go write your own so you can use the default configuration file as a configuration file
// modify nginx configuration files, add fastcgi support
[root @ CentOS ~] # vi /etc/nginx/nginx.conf
index index.php index.htm index.html;
// Add the index.php
LOCATION ~ \ $ {.php
            the root / usr / Share / Nginx / HTML;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index the index.php;
            fastcgi_param SCRIPT_FILENAME / usr / Share / Nginx / HTML $ fastcgi_script_name;
            the include fastcgi_params;
        }
// remove the above code comments, and to modify the default path nginx


10. the configuration PHP
// edit the php.ini file, add the end of the file. 1 = cgi.fix_pathinfo
[the CentOS the root @ ~] VI /etc/php.ini #


11. The restart PHP-FPM Nginx
[the CentOS the root @ ~] # Nginx the restart-Service
[the CentOS the root @ ~] # PHP-FPM the restart-Service


12. The build file info.php
[root @ CentOS ~] # vi /usr/share/nginx/html/info.php
Published 117 original articles · won praise 4 · views 80000 +

Guess you like

Origin blog.csdn.net/qq_36266449/article/details/78194655