LNMP Source Compiling environment "build dynamic Website"

Source: Internet
Author: User
Tags fpm time zones mcrypt

Nginx source installed in the/application/directory
MYSQL binary installed in the/usr/local/directory
PHP source installed in the/application/directory
Create MySQL and nginx users and groups

Nginx Test Connection number
Vim/usr/local/nginx/conf/nginx.conf
server {
Listen 80;
server_name status.zxq.cn;
Stub_status on;
Access_log off;
}
Add resolution in Host

Active connections//Active connections
Server//Indicates how many links are processed together
Accepts//How many times to build a handshake
Handled Requests//indicates how many requests have been processed altogether
Writing//number of messages returned to the client header
Waiting//Wait for the next request resident number

Nginx Log
Parameter list:
$remote the IP address of the _ADDR client (proxy server, display Proxy service IP)
$remote _user is used to record the user name of the remote client (typically "-")
$time _local for recording access times and time zones
$request the URL used to record the request and the request method
$status response status Code, for example: 200 successful, 404 Page not Found etc.
$body _bytes_sent The number of bytes of file principal content sent to the client
$http agent used by _user_agent users (typically browser)
$http _x_forwarded_for can record the client IP and log the client's IP address through a proxy server
$http _referer can record which link the user is accessing from.

Backup Log

PHP Source Installation
Install dependent environments

Yum install-y Lib Zlib-devel libxml libxml2-devel libjpeg libjpeg-devel freetype freetype-devel libpng libpng-devel GD GD -devel Curl Curl-devel Libiconv

Install three encryption modules:


Deploying Libmcrypt
Tar XF libmcrypt-2.5.8.tar.gz
CD libmcrypt-2.5.8
./configure
Make-j8 && make Install
/sbin/ldconfig
CD libltdl/
./configure--enable-ltdl-install
Make && make install

Deploying Mhash
Tar XF mhash-0.9.9.9.tar.gz
CD mhash-0.9.9.9
./configure && make && make install
Ln-s/usr/local/lib/libmcrypt.la/usr/lib64/libmcrypt.la
Ln-s/usr/local/lib/libmcrypt.so/usr/lib64/libmcrypt.so
Ln-s/usr/local/lib/libmcrypt.so.4/usr/lib64/libmcrypt.so.4
Ln-s/usr/local/lib/libmcrypt.so.4.4.8/usr/lib64/libmcrypt.so.4.4.8
Ln-s/USR/LOCAL/LIB/LIBMHASH.A/USR/LIB64/LIBMHASH.A
Ln-s/usr/local/lib/libmhash.la/usr/lib64/libmhash.la
Ln-s/usr/local/lib/libmhash.so/usr/lib64/libmhash.so
Ln-s/usr/local/lib/libmhash.so.2/usr/lib64/libmhash.so.2
Ln-s/usr/local/lib/libmhash.so.2.0.1/usr/lib64/libmhash.so.2.0.1
Ln-s/usr/local/bin/libmcrypt-config/usr/bin/libmcrypt-config

Deploying MCrypt
Tar XF mcrypt-2.6.8.tar.gz
CD mcrypt-2.6.8
./configure ld_library_path=/usr/local/lib && make && make install

Configure PHP./configure
./configure--prefix=/applicaiton/php5.3.27--with-mysql=/usr/local/mysql--with-iconv-dir =/usr/local/libiconv--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr-- Enable-xml--disable-rpath--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem-- Enable-inline-optimization--with-curl--with-curlwrappers--enable-mbregex--enable-fpm--enable-mbstring-- With-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets-- With-xmlrpc--enable-zip--enable-soap--enable-short-tags--enable-zend-multibyte--enable-static--with-xsl-- With-fpm-user=nginx--with-fpm-group=nginx--enable-ftp

Make in error and workaround:
Error: 1
Generating phar.php
/root/php-5.3.27/sapi/cli/php:error while loading shared Libraries:libmysqlclient.so.18:cannot open Shared object file : No such file or directory
Make: [ext/phar/phar.php] Error 127
Make:
waiting for unfinished jobs ....
Ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib64/
Error: 2
Chmod:cannot access ' Ext/phar/phar.phar ': No such file or directory
Make: [Ext/phar/phar.phar] Error 1 (ignored)
Mkdir-p Ext/phar/phar.phar

Make install

Uploading and enabling the PHP-FPM service
cd/application/php/etc/
Rz

[Email protected] etc]#/APPLICATION/PHP/SBIN/PHP-FPM
[07-aug-2018 21:33:56] error:failed to open Error_log (/app/logs/php-fpm.log): No such file or directory (2)
[07-aug-2018 21:33:56] Error:failed to post process the configuration
[07-aug-2018 21:33:56] ERROR:FPM initialization failed
[Email protected] etc]# mkdir-p/app/logs
[Email protected] etc]#/APPLICATION/PHP/SBIN/PHP-FPM



Build a dynamic website:
[Email protected] ~]# wget
Http://kaiyuan.hudong.com/download.php?n=HDWiki-v6.0GBK-20170209.zip

Yum Install-y Unzip
Unzip Download.php\?n\=hdwiki-v6.0gbk-20170209.zip
CD hdwiki/
Ls
MV */usr/local/nginx/html/
Chown-r nginx:nginx/usr/local/nginx/html/

Create a wiki database and create a wiki user password Wiki to all permissions for the wiki user wiki database
Refresh Permissions
Nginx-s Reload

LNMP Source Compiling environment "build dynamic Website"

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.