LNMP One-click installation script (contains NP and MySQL separation)

Source: Internet
Author: User
Tags fpm install php soap openssl xsl zend aliyun egrep

Based on the Lanny one-click installation package: (including LNMP required software and configuration files)

Install Nginx:

wget-o/etc/Yum. Repos.d/centos-base.repo http://Mirrors.aliyun.com/repo/centos-7.repowget-o/etc/Yum. Repos.d/epel.repo http://Mirrors.aliyun.com/repo/epel-6.repoYum Clean AllYumMakecacheYum InstallPcre Pcre-devel OpenSSL Openssl-devel-y useradd-s/sbin/nologin-M nginx CD/home/lanny/tools/&&TarXF nginx-1.6.2.Tar. GZCD/home/lanny/tools/nginx-1.6.2&&./configure--user=nginx--group=nginx--prefix=/application/nginx-1.6.2--with-http_stub_status_module--with-Http_ssl_module Make&& Make InstallEcho$?LN-s/application/nginx-1.6.2//application/nginx

cd/home/lanny/tools/&&UnzipNginx_config.ZipCD/home/lanny/tools/Nginx_configmkdir-p/application/nginx/conf/extra \CP*.conf/application/nginx/conf/extra/\MV/application/nginx/conf/extra/nginx.conf/application/nginx/conf//application/nginx/sbin/nginx-T/application/nginx/sbin/Nginx/application/nginx/sbin/nginx-s Reloadmkdir/application/nginx/html/{Www,blog,bbs} forNinchwww blog bbs; Do Echo "$n. lanny.com">/application/nginx/html/$n/index.html; Done forNinchwww blog bbs; Do Cat/application/nginx/html/$n/index.html; Donemkdir/data/html/-PMV/application/nginx/html/*/data/html/

Install MySQL: (integrated)

 mkdir -p/application/mysql-5.5 . Span style= "color: #800080;" >32  cd /home/lanny/tools/&& tar  XF mysql-5.5 . 32 -linux2. 6 -x86_64. tar  .gz  MV /home/lanny/tools/mysql-32 -linux2. 6 -x86_64/*  /application/mysql-5.5.32ln-s/application/mysql-5.5.32/application/mysqluseradd- s/sbin/nologin-m MySQL cd/application/mysql/data &&rm-rf *  
Chown-R mysql.mysql/application/mysql/data/\CP/application/mysql/support-files/my-small.cnf/etc/my.cnf\CP/application/mysql/support-files/mysql.server/etc/init.d/mysqldchmod+x/etc/init.d/mysqldsed-I.'s#/usr/local/mysql#/application/mysql#g'/etc/init.d/mysqldsed-I.'s#/usr/local/mysql#/application/mysql#g'/application/mysql/bin/Mysqld_safeEcho 'export path= "/application/mysql/bin/: $PATH"'>>/etc/ Profile/application/mysql/scripts/mysql_install_db--user=mysql--basedir=/application/mysql/--datadir=/application/ mysql/data//application/mysql/bin/mysqld_safe &netstat-ntulp|Egrep "Mysql|nginx"


Install PHP:

Yum InstallZlib-devel libxml2-devel Libjpeg-devel Libiconv-devel-yYum InstallFreetype-devel libpng-devel gd-devel curl-devel libxslt-devel-yrpm-qa Zlib-devel libxml2-devel rpm-qa freetype-devel libjpeg-turbo-devel libpng-devel gd-devel libcurl-devel libxslt-develYum InstallLibmcrypt-devel Mhash Mhash-devel MCrypt-yrpm-qa libmcrypt-devel mhash mhash-devel mcrypt libxslt-devel Libiconv-devel Manual Mountingwgethttp//ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gzCD/home/lanny/tools/TarXF libiconv-1.14.Tar. GZCD Libiconv-1.14./configure--prefix=/usr/local/Libiconv Make Make InstallCD/home/lanny/ToolsTarXF php-5.3. -.Tar. GZLN-s/application/mysql/lib/libmysqlclient.so. -/usr/lib64/Touch/home/lanny/tools/php-5.3. -/ext/phar/phar.phar

cd/home/lanny/ToolsTarXF php-5.3. -.Tar. GZCD php-5.3. -./Configure--prefix=/application/php-5.3. - --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--enable-safe-Mode--disable-rpath--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&& Make InstallLN-s/application/php-5.3. -/application/php

CP /home/lanny/tools/php-5.3. /php.ini-production/application/php/lib//application/php/etc/&&CP /home/lanny/tools/php-fpm.conf.default./php-fpm.confmkdir /app/logs/-pTouch /app/logs/php-fpm.log/application/php/sbin/php-fpm-t/application/php/sbin/php-  -ntulp| Egrep " 80|330|9000 "

Nginx Support PHP

\cp /home/lanny/tools/bbs.conf/application/nginx/conf/extra//application/nginx/sbin/nginx-s Reload boot from:/application/nginx/sbin/nginx/etc/init.d/mysqld start

Complete BBS configuration:
/application/nginx/conf/extra/bbs.conf
server {
Listen 80;
server_name bbs.lanny.com;
Root/data/html/bbs;
Index index.html index.php index.htm;
Access_log Logs/bbs_access.log;


Location ~. *\. (PHP|PHP5)? $
{
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Include fastcgi.conf;
}
}

Database connection test:

dbconn.php
<?PHP//$link _id=mysql_connect (' Host name ', ' user ', ' password ');$link _id=mysql_connect ('localhost','Root','123456') or mysql_error (); if($link _id) {Echo "mysql successful by Lanny!"; }Else{ Echomysql_error (); }?>

MySQL and NP installation scripts-----NP and MySQL separation

./Configure--prefix=/application/php-5.3. - --with-mysql=Mysqlnd--with-pdo-mysql=Mysqlnd--with-iconv-dir=/usr/local/Libiconv--with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib--with-libxml-dir=/usr--enable-XML--enable-safe-Mode--disable-rpath--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

Above at least 38 lines, in fact 39 rows

Installing Discuzz

cd/home/lanny/tools/&&wget http://download.comsenz.com/discuzx/3.2/ Discuz_x3.2_sc_utf8.zipunzip Discuz_x3.2_sc_utf8. Zip rm -RF readme/utility/mv upload/*  /data/html/bbschown-r nginx.nginx/data/html/ BBS Creation Database: Create databases bbs;grant all on bbs.* to [e-mail protected] ' localhost ' identified by ' BBS '; flush privileges; #安装的时 Hou database BBS password BBS

LNMP One-click installation script (contains NP and MySQL separation)

Related Article

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.