Installation nginx + php-fpm + mysql on Centos

        CentOS (Community Enterprise Operating System, Chinese meaning: Community Enterprise Operating System) is one of the Linux distributions.

        Nginx ( "engine x") is a high performance HTTP and reverse proxy server is a IMAP / POP3 / SMTP server.

        PHP-FPM is a PHPFastCGI manager, is used only for PHP. Introduction to PHP-FPM (FastCGI Process Manager: FastCGI Process Manager) for php before PHP 5.3.3, it is a patch 1, FastCGI Process Manager is designed to be integrated into the PHP package.         

        MySQL is a relational database management system, developed by the Swedish company MySQL AB, currently part of Oracle's products.

      

  1. Installation nginx / php-fpm / mysql note path where nginx html (positioned behind the code), each of the configuration file and log path;
  2. Configuring nginx virtual server (e.g., port 80), preferably disposed php-fpm open access log rewrite the like.;
  3. Provided mysql, the initial root password (step 7 can be placed in) to create a database "sns", import data file.;
  4. Open network ports, Selinux security settings ...... and so on;
  5. Access simple html / php files through external verification nginx / php-fpm is correct, if not correct, by nginx / php-fpm log investigation.;
  6. Upload code configured (database account);
  7. Create a database "sns", import data files;
  8. By accessing the external server to verify correct. If not correct, by nginx / php log investigation.        

 

        Install Nginx

        To download four package

       a.SSL feature requires openssl library Download: http://www.openssl.org/

   b.gzip module requires zlib library, Download: http://www.zlib.net/

   c.rewrite module requires pcre library Download: http://www.pcre.org/

   installation package d.Nginx: Download address: http://nginx.org/en/download.html

 

        Installation php-fpm, it is necessary to compile the source code to install

        wget http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz

        wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.7.5-9.tar.gz  

 

        Mysql installation

To install mysql database via yum, were installed in this way, can be associated with some mysql service, jar package gave us installed, so save a lot of unnecessary trouble. :

        yum list | grep mysql // View all versions

        yum install 

       If you want to install the latest version of MySQL, Oracle's MySQL need to go to the home page, download the latest release version, and then install.

       Check mysql version:

       rpm -qi mysql-server

 

       Permanent start and start Nginx and PHP-FPM:

       service nginx start  

       service php-fpm start 

       After installing nginx and php-fpm, view the installed version:

        SELinux 2.6 version of the Linux kernel mandatory access control (provided in the MAC ) system. For the currently available Linux security module is, SELinux is the most comprehensive and most fully tested, it is built on research-based MAC 20 years on.

      View Selinux status: / usr / sbin / sestatus -v

       

       Since SELinux with existing Linux applications and Linux kernel module compatibility are still some problems, it is recommended for beginners to turn off selinux:

Closed under / etc / sysconfig / selinux.

       

       

Guess you like

Origin www.cnblogs.com/fengye151/p/11664758.html