Based on the LNMP discuz Forum, php MySQL nginx for a separate server, PHP installation xcache for sharing opcode

Source: Internet
Author: User

Experimental platform: RHEL5.8

Experimental topology:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/2B/C6/wKioL1OK6mvgcb0xAAD4LarQqEg531.jpg "title=" QQ picture 20140601164917.jpg "alt=" Wkiol1ok6mvgcb0xaad4larqqeg531.jpg "/>

PHP configuration section:


1. Compile and install PHP


./configure--prefix=/usr/local/php--with-mysql=mysqlnd--with-openssl--with-mysqli=mysqlnd--enable-mbstring-- With-freetype-dir--with-gpg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-sockets--enable-fpm-- With-mycrypt--with-config-file-path=/etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2-- Enable-maintainer-zts


Make && make install


2. Configure PHP

2.1 To provide the service script, the source package cp/sapi/fpm/init.d.php-fpm to the corresponding directory

2.2cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf

Provide the configuration file for php-fpm and modify the listening address and the number of open processes, the minimum idle process, and the maximum idle process

2.3 Copy the php.ini-production to/etc/php.ini under the source package to become a PHP configuration file


3. Compile and install XCache

Execute/usr/local/php/bin/phpize under 3.1xcache source code directory

3.2./configure--enable-xcache--with-php-config=/usr/local/php/bin/php-config

3.3 Make && make install



MySQL section:

Universal Binary Installation mysql5.5

1. Create MySQL user MySQL Group

2, create the data directory/mydata/data and set the data directory of the owner, belong to the group of MySQL

3, the MySQL directory belongs to the group set to the root group set to MySQL

4. CP Support-files/mysql.server/etc/init.d/mysqld Copy startup script

5. CP support-files/my-large.cnf/etc/my.cnf Copy configuration file

6. Modify the configuration file

Datadir=/mydata/data

Innodb_file_per_table = On

7. Initialize the database

./scripts/mysql_install_db--user=mysql--datadir=/mydata/data

8. Service Mysqld Start Database

9. Output library file and header file and man page file

Library file output Vi/etc/ld.so.conf.d/mysql add/usr/local/mysql/lib

Header file output ln-s/usr/local/mysql/include//usr/include/mysql

Man page file Output Manpath/usr/local/mysql/man

10, add a database user so that the remote host can log in, which is mainly for the Discuz server connection

Grant all on * * to [e-mail protected] "10.32.9.%" identified by "Redhat";

Flush privileges;



Nginx part:

1, add the user group Nginx operation Nginx

2. Compile and install Nginx

./configure \

--PREFIX=/USR \

--sbin-path=/usr/sbin/nginx \

--conf-path=/etc/nginx/nginx.conf \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--pid-path=/var/run/nginx/nginx.pid \

--lock-path=/var/lock/nginx.lock \

--user=nginx \

--group=nginx \

--with-http_ssl_module \

--with-http_flv_module \

--with-http_stub_status_module \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/tmp/nginx/client/\

--http-proxy-temp-path=/var/tmp/nginx/proxy/\

--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/\

--HTTP-UWSGI-TEMP-PATH=/VAR/TMP/NGINX/UWSGI \

--HTTP-SCGI-TEMP-PATH=/VAR/TMP/NGINX/SCGI \

--with-pcre

Make && make install

3. Configure Nginx

Location/{root HTML; Index index.html index.htm index.php;----Add the PHP home page you can handle
  location ~ \.php$ {             root            html;            fastcgi_pass    10.32.9.52:9000;  ------PHP page forwarding to the appropriate PHP server              fastcgi_index  index.php;             fastcgi_param  SCRIPT_FILENAME   $document _root$fastcgi_script_name ;----Key Configuration             include         fastcgi_params;        } 

edit/etc/nginx/fastcgi_params to change its contents to the following:

fastcgi_param  gateway_interface  cgi/1.1;fastcgi_param  server_software     nginx;fastcgi_param  QUERY_STRING        $query _ string;fastcgi_param  request_method      $request _method;fastcgi_param   CONTENT_TYPE        $content _type;fastcgi_param   content_length      $content _length;fastcgi_param  script_filename      $document _root$fastcgi_script_name;fastcgi_param  script_name          $fastcgi _script_name;fastcgi_param  request_uri          $request _uri;fastcgi_param  document_uri         $document _uri;fastcgi_param  document_root       $document _ Root;fastcgi_param  server_protocol     $server _protocol;fastcgi_param  remote_addr          $remote _addr;fastcgi_param  remote_port          $remote _port;fastcgi_param  server_addr          $server _addr;fastcgi_param  server_port         $server _port;fastcgi_param  server_name         $server _name;

Attention problem: Static and dynamic separation, files need to be in Nginx and PHP server each put a copy!!!!!!!!!!


Installation and Test Discuz


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.