Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install lanp and lnmp on the same CentOS release 6.5 (Final) x86x64

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

CentOS release 6.5 (Final) x86x64

Lamp

Apache

Wget http://archive.apache.org/dist/httpd/httpd-2.2.27.tar.gz

Tar cd

/ configure-- prifix=/application/apache2.2.27-- enable-deflate-- enable-expires-- enable-headers-- enable-modules=most-- enable-so-- with-mpm=worker-- enable-rewrite

Yum install-y zlib-devel

Make & & make install

Ln-s / application/apache2.2.27/ / application/apache

Ll / application/apache/conf/httpd.conf

/ application/apache/bin/apachectl-t

/ application/apache/bin/apachectl graceful

Ps-ef | grep httpd

Mqsql

Wget https://downloads.mysql.com/archives/get/file/mysql-5.1.68.tar.gz

Tar cd

/ configure-- prefix=/application/mysql5.1.68/-- with-unix-socket-path=/application/mysql5.1.68/tmp/mysql.sock-- localstatedir=/application/mysql5.1.68/data-- enable-assembler-- enable-thread-safe-client-- with-mysqld-user=mysql-- with-big-tables-- without-debug-- with-pthread-- enable-assembler-- with-extra-charsets=complex-- with-readline-- with-ssl-- with-embedded-server-- enable-local-infile-- with-plugins=partition Innobase-with-mysqld-ldflags=-all-static-with-client-ldflags=-all-static-with-plugin-PLUGIN

Echo $?

Yum install-y ncurses-devel

Make & & make install

/ home/oldboy/mysql-5.1.68/support-files/my-small.cnf / etc/my.cnf

/ application/mysql/bin/mysql_install_db-basedir=/application/mysql-datadir=/application/mysql/data-user=mysql

/ home/oldboy/mysql-5.1.68/support-files/mysql.server / etc/init.d/mysqld

Log in to mysql test

Php

1.php dependency package

Yum install-y zlib libxml libpng libjpeg freetype gd curl libiconv zlib-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gd-devel curl-devel libcronv-devel openssl-devel libcurl-devel libxslt-devel

2.php package

Http://php.net/get/php-5.3.27.tar.gz/from/a/mirror is downloaded locally and transferred to the user's home directory

Tar xf php-5.3.27.tar.gz

Cd php-5.3.27

/ configure-- prefix=/application/php5.3.27-- with-apxs2=/application/apache/bin/apxs-- with-mysql=/application/mysql-- with-xmlrpc-- with-openssl-- with-zib-- with-freetype-dir-- with-gd-- with-jpeg-dir-- with-png-dir-- with-iconv=/usr/local/libiconv-- enable-short-tags-- enable-sockets-- enable-zend-multibyte-- enable-soap-- enable-mbstring-- enable -gd-native-ttf-with-curl-with-xsl-enable-ftp-with-libxml-dir

Make

Make install

Ln-s / application/php5.3.27 / application/php

Cp php.ini-production / application/php/lib/php.ini

/ application/apache/conf/httpd.conf modifies apache's

LoadModule php5_module modules/libphp5.so

User www

Group www

ServerName 127.0.0.1:80

DirectoryIndex index.php index.html

Useradd-M-s / sbin/nologin www

/ application/apache/bin/apachectl graceful

Test browser-- index.html > > apache--index.php > > php--php script > > mysql

Php script content

Lnmp

Install nginx

Wget http://nginx.org/download/nginx-1.6.2.tar.gz

Tar zxvf nginx-1.6.2.tar.gz

Cd nginx-1.6.2

Useradd-M-s / sbin/nologin nginx

Yum install gcc pcre-devel openssl-devel-y

. / configure-user=nginx-group=nginx-prefix=/application/nginx1.6.2-with-http_stub_status_module-with-http_ssl_module

Make

Make install

/ application/nginx1.6.2/sbin/nginx-t

/ application/nginx1.6.2/sbin/nginx

Ps-ef | grep nginx

Pay attention to the firewall

Install mysql with binaries

Wget https://downloads.mysql.com/archives/get/file/mysql-5.5.32-linux2.6-x86_64.tar.gz-- no-check-certificate

Tar-zxvf mysql-5.5.32-linux2.6-x86_64.tar.gz

Mv mysql-5.5.32-linux2.6-x86_64 / application/mysql

Cp my-small.cnf / etc/my.cnf

Useradd-M-s / sbin/nologin mysql

. / mysql_install_db-- user=mysql-- basedir=/application/mysql-- datadir=/application/mysql/data

Cp support-files/mysql.server / etc/init.d/mysqld

Modify basedir and datadir in / etc/init.d/mysqld

/ etc/init.d/mysqld start

test

/ application/mysql/bin/mysql

Export PATH=$PATT:/application/mysql/bin/mysql

Php

Php dependency package

Yum install-y zlib libxml libpng libjpeg freetype gd curl libiconv zlib-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gd-devel curl-devel libcronv-devel openssl-devel libcurl-devel libxslt-devel gcc gcc-c++ libxslt

Wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

Tar-zxvf libiconv-1.14.tar.gz

Cd libiconv-1.14

. / configure-- prefix=/usr/local/libiconv

Make & & make install

Wget https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz-- no-check-certificate

Tar-zxvf libmcrypt-2.5.8.tar.gz

Cd libmcrypt-2.5.8

. / configure

Make

Make install

Sleep 2

/ sbin/ldconfig

Cd libltdl/

. / configure-- enable-ltdl-install

Make & & make install

Wget https://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz-- no-check-certificate

Tar-zxvf mhash-0.9.9.9.tar.gz

Cd mhash-0.9.9.9

. / configure

Make & & make install

Rm-f / usr/lib64/libmhash.

Rm-f / usr/lib64/libmcrypt.*

Ln-s / usr/local/lib64/libmcrypt.la / usr/lib64/libmcrypt.la

Ln-s / usr/local/lib64/libmcrypt.so / usr/lib64/libmcrypt.so

Ln-s / usr/local/lib64/libmcrypt.so.4 / usr/lib64/libmcrypt.so.4

Ln-s / usr/local/lib64/libmcrypt.so.4.4.8 / usr/lib64/libmcrypt.so.4.4.8

Ln-s / usr/local/lib64/libmhash.a / usr/lib64/libmhash.a

Ln-s / usr/local/lib64/libmhash.la / usr/lib64/libmhash.la

Ln-s / usr/local/lib64/libmhash.so / usr/lib64/libmhash.so

Ln-s / usr/local/lib64/libmhash.so.2 / usr/lib64/libmhash.so.2

Ln-s / usr/local/lib64/libmhash.so.2.0.1 / usr/lib64/libmhash.so.2.0.1

Ln-s / usr/local/lib64/libmcrypt-config / usr/lib64/libmcrypt-config

Wget https://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz-- no-check-certificate

Tar-zxvf mcrypt-2.6.8.tar.gz

Cd mcrypt-2.6.8

/ sbin/ldconfig

. / configure LD_LIBRARY_PATH=/usr/local/lib

Make

Make install

Php installation

Wget http://mirrors.sohu.com/php/php-5.3.27.tar.gz

Tar-zxvf php-5.3.27.tar.gz

Cd php-5.3.27

/ configure-- prefix=/application/php5.3.27-- with-mysql=/application/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-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

Ln-s / application/mysql/lib/libmysqlclient.so.18 / usr/lib64

Make

Make install

Ln-s / application/php5.3.27/ / application/php

Cp php.ini-production / application/php/lib/php.ini

Cd / application/php/etc/

Cp php-fpm.conf.default php-fpm.conf

In vim php-fpm.conf.

Pid = / app/logs/php-fpm.pid

Error_log = / app/logs/php-fpm.log

Log_level = error

Rlimit_files = 32768

Listen.owner = nginx

Listen.owner = nginx

Pm.max_children = 1024

Pm.start_servers = 16

Pm.min_spare_servers = 5

Pm.max_spare_servers = 20

Pm.process_idle_timeout = 15s

Pm.max_requests = 2048

Slowlog = / app/logs/$pool.log.slow

Request_slowlog_timeout = 10

Php_admin_ value [Sendmail _ path] = / usr/sbin/sendmail-t-I-f wenxianfeng@linekong.com

Mkdir / app/logs-p

/ application/php/sbin/php-fpm-t

/ application/php/sbin/php-fpm

Netstat-nltpu | grep php-fpm

Ps-ef | grep php-fpm

Boot self-boot / etc/rc.local

/ etc/init.d/mysqld start

/ application/php/sbin/php-fpm

/ application/nginx1.6.2/sbin/nginx

Add a decision in the nginx virtual host that if the .php file calls the fastcgi of php

Location. *. (php | php5)? ${

Fastcgi_pass 127.0.0.1:9000

Fastcgi_index index.php

Include fastcgi.conf

}

Refresh the page or / application/php/bin/php wen.php

Download the official version of HDwiki5.1 from http://kaiyuan.baike.com/ and put it in the directory of the site.

Unzip HDWiki-v5.1GBK-20141205.zip

Put the files in the wiki directory into the site directory

Refresh the web page, graphic configuration wiki

Nginx reverse proxy

Set up the nginx service on the server, after the service is normal

Egrep-v "^ $| #" nginx.conf.default > nginx.conf

Upstream backend {

Server backend web:80 max_fails=3 fail_timeout=30s

Server backend web:80 max_fails=3 fail_timeout=30s

}

According to http://nginx.org/en/docs/http/ngx_http_upstream_module.html upstream and proxy module

Add to the nginx virtual host

Location / {

Proxy_pass http://backend;

}

Constantly visit the reverse proxy server to see if it can be processed by the back-end server or write for loop to test on the reverse proxy machine.

The client resolves the domain name into a reverse proxy ip, which is handed over to the back-end server (ip). By default, the first virtual host is read. If you want to read the virtual host of a domain name, you need to add it in the configuration file of the reverse proxy server.

Proxy_set_header Host $host

Proxy_set_header X-Forwarded-For $remote_addr

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report