Organize your own LNMP installation

Source: Internet
Author: User

1. Operating system
CentOS Release 6.5 (final)
2. Install MySQL
# yum Install Mysql-server
#vi/etc/my.cnf +default-character-set=utf8
#chkconfig--add mysqld chkconfig--level mysqld on//boot start view #chkconfig--list | grep mysql*
#service mysqld Stop//stop restart//restart start//start
#mysqladmin-u root password 123456//Set Administrator password
#UPDATE user SET ' Host ' = '% ' WHERE ' user ' = ' root ' LIMIT 1; FLUSH privileges;//all host root connections
#vi/etc/sysconfig/iptables
Added:-A input-m State--state new-m tcp-p TCP--dport 3306-j ACCEPT
#service iptables Restart
3. Installing Nginx
Install Nginx's Yum source first
Http://nginx.org/en/linux_packages.html#stable find the link to install:
#rpm-IVH http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
View:
#yum Info Nginx
Installation:
#yum Install Nginx
#service Nginx Start
Default configuration:/etc/nginx/conf.d/
4. Install PHP
#wget Http://cn2.php.net/get/php-5.6.23.tar.gz/from/this/mirror
#tar –ZXVF php-5.6.23.tar.gz
#yum Install Epel-release
Or
#rpm-UVH http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#yum install GCC bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-deve L bzip2-devel readline-devel libedit-devel sqlite-devel libpng-devel
#cd php-5.6.23
#./configure \
--PREFIX=/USR/LOCAL/PHP56 \
--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP56/ETC \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-opcache \
--ENABLE-FPM \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--WITH-MYSQL=MYSQLND \
--WITH-MYSQLI=MYSQLND \
--WITH-PDO-MYSQL=MYSQLND \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--WITH-OPENSSL \
--enable-bcmath \
--ENABLE-SOAP \
--with-libxml-dir \
--ENABLE-PCNTL \
--ENABLE-SHMOP \
--ENABLE-SYSVMSG \
--enable-sysvsem \
--ENABLE-SYSVSHM \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-zip \
--WITH-BZ2 \
--WITH-GD \
--with-readline
#make-j8
#make Install
Configure PHP
Configuration file:
# CP Php.ini-development/usr/local/php56/etc/php.ini
PHP-FPM Service
# cp/usr/local/php56/etc/php-fpm.conf.default/usr/local/php56/etc/php-fpm.conf
# CP Sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm56
# chmod +X/ETC/INIT.D/PHP-FPM56
Start PHP-FPM
# service PHP-FPM56 Start
Starting php-fpm Done
PHP-FPM Available Parameters Start|stop|force-quit|restart|reload|status
Adding PHP commands to environment variables
Edit the ~/.bash_profile to:
Path= $PATH: $HOME/bin
Switch
Path= $PATH: $HOME/bin:/usr/local/php56/bin
Make the PHP environment variable effective:
# . ~/.bash_profile
See PHP version
# php-v

Organize your own LNMP installation

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.