: This article mainly introduces how to build a source code package in the lnmp environment to install linux, nginx, mysql, and php. if you are interested in the PHP Tutorial, refer to it. Environment: contos 6.5
Note:
Source code directory:/data/software/soft
Installation directory:/usr/local/webserver/
Source code package: http://pan.baidu.com/s/1kTy3UXh
Preparation:
yum -y install gcc automake autoconf libtool makeyum -y install gcc gcc-c++ glibcyum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel
Install the php script:
spath=/data/software/softcd ${spath}tar zvxf php-5.6.9.tar.gzcd php-5.6.9webpath=/usr/local/webserver./configure --prefix=${webpath}/php --enable-fpm --with-openssl --with-mcrypt --enable-mbstring --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dirmake all install
Prepare nginx installation, and install the zlib, openssl, and pcre scripts:
spath=/data/software/softcd ${spath}tar -xzvf pcre-8.34.tar.gz tar -xzvf openssl-1.0.1c.tar.gz tar -xzvf zlib-1.2.8.tar.gzcd ${spath}/zlib-1.2.8./configuremake && make installcd ${spath}/openssl-1.0.1c./config ./config -tmake && make installcd ${spath}/pcre-8.34./configuremakemake install
Install the nginx script (including the echo and realip modules ):
webpath=/usr/local/webserverspath=/data/software/softcd ${spath}tar xzvf nginx-1.4.2.tar.gztar xzvf echo-nginx-module-0.57.tar.gzcd nginx-1.4.2./configure --sbin-path=${webpath}/nginx/nginx --conf-path=${webpath}/nginx/nginx.conf --pid-path=${webpath}/nginx/nginx.pid --with-http_ssl_module --with-pcre=${spath}/pcre-8.34 --with-zlib=${spath}/zlib-1.2.8 --with-openssl=${spath}/openssl-1.0.1c --add-module=/data/software/soft/echo-nginx-module-0.57 --with-http_realip_modulemake && make install
Install mysql script
yum install ncurses-develgroupadd mysqluseradd -r -g mysql mysqlspath=/data/software/softcd ${spath}tar zvxf mysql-5.6.16.tar.gzcd mysql-5.6.16cmake -DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql -DMYSQL_UNIX_ADDR=/usr/local/webserver/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1make && make installchown mysql.mysql -R /usr/local/webserver/mysqlchown mysql.mysql -R /data/mysqldb/usr/local/webserver/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysqldbcp /usr/local/webserver/mysql/support-files/my-default.cnf /etc/my.cnf
Mysql-related operations
Cp support-files/mysql. server/etc/init. d/mysqld vim/etc/profile // add to $ PATH =/usr/local/webserver/mysql/bin:/usr/local/webserver/mysql/lib: $ PATH export PATHsource/etc/profile // enable service mysqld start // start mysqlchkconfig -- level 35 mysqld on // set the start of netstat-tulnp | grep 3306 // view the port mysql -u root-p // log on to mysqladmin-u root password '000000' // Set the password
The above describes how to set up the source code package in the lnmp environment to install linux, nginx, mysql, and php, including some content. I hope my friends who are interested in the PHP Tutorial will be helpful.