requirements: Internal staff often to consult the information, consider building a wiki site in the intranet .
Experimental topology:
650) this.width=650; "style=" WIDTH:477PX;HEIGHT:339PX; "alt=" Mkfy9%tf ' ddaf$wcmhla_wc.png "src=" http:// Www.178linux.com/ueditor/php/upload/image/20151009/1444397895230771.png "title=" 1444397895230771.png "height=" 339 "width=" 477 "/>
Lab Environment:
Nginx,php:192.168.198.160
mysql:10.0.0.8
Package:
Hdwiki-v5.1utf8-20141205.zip
Nginx-1.8.0.tar.gz
Xcache-3.2.0.tar.gz
Mysql-5.5.46-linux2.6-x86_64.tar.gz
php-5.3.27.tar.bz2
1. Installing Nginx
1.1 Preparation
Ntpdate 202.120.2.101yum Install pcre-devel-y #解决依赖关系useradd-R-s/sbin/nologin Nginx #添加Nginx用户和组
1.2 compiling and installing
CD/TOOLSTAR-XF nginx-1.8.0.tar.gzcd nginx-1.8.0./configure--prefix=/usr/local/nginx--user=nginx--group=nginx-- With-http_stub_status_modulemake && make Install
1.3 provisioning profile ( This step in compiling php< Span style= "font-family: ' The song Body '; , save time )
worker_processes 1;events { worker_connections 1024;} http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name wiki.edelweiss0.com; location / { root html/wiki; index index.html index.htm index.php; } error_page 500 502 503 504 / 50x.html; location = /50x.html { root html; } location ~ \.php$ { root html/wiki; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } }}
2. Install PHP
2.1 Resolving dependencies
Yum install zlib libxml libjpeg freetype libpng gd Curl zlib-devel libxml2-devel libjpeg-devel freetype-devel Libpng-dev El gd-devel curl-devel openssl-devel libxslt-devel-y
wget Http://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gztar zxf libiconv-1.14.tar.gzcd libiconv-1.14./configure-- Prefix=/usr/local/libiconvmakemake install# If there is a dependency error, self-Baidu, install the corresponding software package can be
2.2 compiling and installing
TAR-XF php-5.3.27.tar.bz2cd php-5.3.27./configure--prefix=/usr/local/php--enable-fpm--with-mysql=mysqlnd-- With-pdo-mysql=mysqlnd--with-mysqli=mysqlnd--with-xmlrpc--with-openssl--with-zlib--with-freetype-dir--WITH-GD- -with-jpeg-dir--with-png-dir--with-iconv=/usr/local/libiconv--enable-short-tags--enable-sockets--enable-soap-- Enable-mbstring--enable-static--enable-gd-native-ttf--with-curl--with-xsl--enable-ftp--with-libxml-dir-- With-fpm-user=nginx--with-fpm-group=nginx--with-config-file-path=/etc--with-config-file-scan-dir=/etc/php.d# It's an OPS guy who says he's in the business. This is configured in the enterprise and does not need to be changed. Can search by itself
Making && make install #这里需要等待一段时间了, you can do the third step at the same time
2.3 Provides a configuration file for php to listen fastcgi in 9000 Port
CP Php.ini-production/etc/php.ini #为php提供配置文件cd/USR/LOCAL/PHP/CP etc/php-fpm.conf.default etc/php-fpm.conf #如果要实现ph P and Web service detach can edit this file, here remains the default
2.4 Installing and configuring the XCache accelerator
TAR-XF xcache-3.2.0.tar.gz cd xcache-3.2.0/usr/local/php/bin/phpize #注意这里要先解压xcache在运行此命令./configure--enable-xca Che--with-php-config=/usr/local/php/bin/php-configmake && make install #注意输出的最后信息Installing shared Extensio NS:/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
MKDIR/ETC/PHP.D #提供xcache扩展配置文件cp xcache.ini/etc/php.d/vim/etc/php.d/xcache.ini[[email protected]ss0 xcache-3.2.0] # diff xcache.ini/etc/php.d/xcache.ini4c4< Extension = xcache.so---> Extension =/usr/local/php/lib/php/ Extensions/no-debug-non-zts-20090626/xcache.so
3. Install MySQL ( on another machine )
3.1 Preparation
mkdir/datacd/usr/local/src/#mysql -5.5.46-linux2.6-x86_64.tar.gztar-xf mysql-5.5.46-linux2.6-x86_64.tar.gz-c/US r/localln-sv/usr/local/mysql-5.5.46-linux2.6-x86_64//usr/local/mysqlgroupadd mysqluseradd-g MySQL mysqlcd/usr/ Local/mysql
3.2 Initializing the database
Chown-r mysql.mysql. scripts/mysql_install_db--user=mysql--datadir=/data/--basedir=/usr/local/mysql # Generally two OK indicates the installation of normal
3.3 providing configuration files and service scripts
CP support-files/my-medium.cnf/etc/my.cnfcp:overwrite '/etc/my.cnf '? Yvim/etc/my.cnf
[Email protected] mysql]# diff/etc/my.cnf support-files/my-medium.cnf38,39c38< datadir=/data< log-error=/data /mysql-err--->
CP Support-files/mysql.server/etc/init.d/mysqldservice mysqld start[[email protected] mysql]# SS-TNL | grep 330LISTEN 0 *:3306 *:* echo "path=/usr/local/mysql/bin:/$PATH" >/etc/profile.d/mysql.sh source/etc/profile.d/mysql.sh
3.4 database and user for a site
mysql> drop database test; #删除无用的数据库Query OK, 0 rows affected (0.06 sec) mysql> Delete from mysql.user where user= '; #删除无用的用户Query OK, 2 rows affected (0.10 sec) mysql> Create database wiki; #创建wiki数据库Query OK, 1 row Affected (0.00 sec) Mysql> Grant all on wiki.* to ' wiki ' @ ' 10.0.0.% ' identified by ' 123456 '; #创建并授权wiki数据的用户Query OK, 0 rows affected (0.05 sec) mysql> flush privileges; #刷新权限Query OK, 0 rows Affected (0.00 sec)
4,integrated Nginx,PHP,MySQL
Sbin/nginx-tnginx:the configuration file/usr/local/nginx/conf/nginx.conf syntax is oknginx:configuration file/usr/lo cal/nginx/conf/nginx.conf test is SUCCESSFULSBIN/NGINX/USR/LOCAL/PHP/SBIN/PHP-FPM
4.1 test Nginx and PHP
mkdir html/wikivim html/wiki/index.php<?php phpinfo ();? >
650) this.width=650, "alt=" l%el@rpjw[$B $ax[{{j[68g.png "src=" http://www.178linux.com/ueditor/php/upload/image/ 20151009/1444398262225755.png "title=" 1444398262225755.png "/>
4.2 Test PHP and MySQL
#注意防火墙的配置vim/usr/local/nginx/html/wiki/index.php<?php $link _id=mysql_connect (' 192.168.198.130 ', ' wiki ', ' 123456 ') or mysql_error (); if ($link _id) {echo "MySQL successful by Yunzhonghe!"; }else{Echo mysql_error (); }?>
650) this.width=650; "alt=" {1 ' r{s5]g6q[r3e0g$28ql1.png "src=" http://www.178linux.com/ueditor/php/upload/image/ 20151009/1444398287475297.png "title=" 1444398287475297.png "/>
4.3 Building Station
Cd/tools/unzip hdwiki-v5.1utf8-20141205.zipmv hdwiki-v5.1utf8-20121102/*/usr/local/nginx/html/wiki/chown Nginx.nginx-r/usr/local/nginx/
650) this.width=650; "alt=" 15pl4}}t%gvops516qk ' ad4.jpg "src=" http://www.178linux.com/ueditor/php/upload/image/ 20151009/1444398323677047.jpg "title=" 1444398323677047.jpg "/>
650) this.width=650; "alt=" [226EKPTO@D183KMS9ES8V3.png "src=" http://www.178linux.com/ueditor/php/upload/image/ 20151009/1444398343870604.png "title=" 1444398343870604.png "/>
# Results show
650) this.width=650; "alt=" 2e6fd0081bff40ce8b5c8146fe71e727.jpg "src=" http://www.178linux.com/ueditor/php/upload/ Image/20151009/1444398376749497.jpg "title=" 1444398376749497.jpg "/>
You can expand it by yourself.
5, Summary: I hope you have something to gain.
This article is from the "Work hard" blog, please be sure to keep this source http://amyhehe.blog.51cto.com/9406021/1701347
LNMP Intranet Deployment Wiki