彩世界平台-彩世界时时app-彩世界开奖app苹果下载

热门关键词: 彩世界平台,彩世界时时app,彩世界开奖app苹果下载

您的位置:彩世界平台 > 彩世界开奖app苹果下载 > LNMP意况搭建完整步骤,lnmp情状搭建

LNMP意况搭建完整步骤,lnmp情状搭建

发布时间:2019-08-30 09:31编辑:彩世界开奖app苹果下载浏览(117)

    彩世界平台,LNMP环境搭建完整步骤,lnmp环境搭建

    零、resource   

    一、centos 6.4、VirtualBox 5.0.14

    二、nginx 1.9.9

         安装

    彩世界平台 1[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# yum install wget [[email protected] src]# wget [[email protected] src]# tar -xzf pcre-8.38.tar.gz [[email protected] src]# cd pcre-8.38/ [[email protected] pcre-8.38]# ./configure --prefix=/usr/local/pcre-8.38 [[email protected] pcre-8.38]# make [[email protected] pcre-8.38]# make install [[email protected] pcre-8.38]# cd ../ [[email protected] src]# yum -y install libjpeg libjpeg-devel libpng libpng-devel libvpx libvpx-devel libXpm libXpm-devel libxml2 libxml2-devel fontconfig fontconfig-devel freetype freetype-devel zlib zlib-devel bzip2 bzip2-devel curl curl-devel openssl openssl-devel [[email protected] src]# groupadd www [[email protected] src]# useradd -g www www [[email protected] src]# passwd www [[email protected] src]# wget [[email protected] src]# tar -xzf nginx-1.9.9.tar.gz [[email protected] src]# cd nginx-1.9.9/ [[email protected] nginx-1.9.9]# ./configure --prefix=/usr/local/nginx-1.9.9 --user=www --group=www --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.38 [[email protected] nginx-1.9.9]# make [[email protected] nginx-1.9.9]# make install [[email protected] nginx-1.9.9]# cd /usr/local/nginx-1.9.9/conf/ [[email protected] conf]# vi nginx.conf user www; worker_processes 10; error_彩世界开奖app苹果下载,log /data/logs/nginx_error.log; pid /data/logs/nginx.pid; http { include vhost/*.conf; } [[email protected] conf]# mkdir vhost rewrite [[email protected] conf]# mkdir -p /data/logs/ [[email protected] conf]# chown -R www.www /data [[email protected] conf]# chmod -R 777 /data [[email protected] conf]# /usr/local/nginx-1.9.9/sbin/nginx -t nginx: the configuration file /usr/local/nginx-1.9.9/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx-1.9.9/conf/nginx.conf test is successful [[email protected] conf]# /usr/local/nginx-1.9.9/sbin/nginx [[email protected] nginx-1.9.9]# ps -ef | grep nginx root 14442 1 0 14:15 ? 00:00:00 nginx: master process /usr/local/nginx-1.9.9/sbin/nginx www 14457 14442 0 14:24 ? 00:00:00 nginx: worker process www 14458 14442 0 14:24 ? 00:00:00 nginx: worker process www 14459 14442 0 14:24 ? 00:00:00 nginx: worker process www 14460 14442 0 14:24 ? 00:00:00 nginx: worker process www 14461 14442 0 14:24 ? 00:00:00 nginx: worker process www 14462 14442 0 14:24 ? 00:00:00 nginx: worker process www 14463 14442 0 14:24 ? 00:00:00 nginx: worker process www 14464 14442 0 14:24 ? 00:00:00 nginx: worker process www 14465 14442 0 14:24 ? 00:00:00 nginx: worker process www 14466 14442 0 14:24 ? 00:00:00 nginx: worker process root 14472 1358 0 14:27 pts/0 00:00:00 grep nginx [[email protected] conf]# curl <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> <p>For online documentation and support please refer to <a href="; Commercial support is available at <a href="; <p><em>Thank you for using nginx.</em></p> </body> </html> View Code

         开机自启

    彩世界平台 2[[email protected] conf]# vi /etc/init.d/nginx #! /bin/sh DESC="nginx service" NAME=nginx DAEMON=//usr/local/nginx-1.9.9/sbin/$NAME CONFIGFILE=/usr/local/nginx-1.9.9/conf/$NAME.conf PIDFILE=/data/logs/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME set -e [ -x "$DAEMON" ] || exit 0 do_start() { $DAEMON -c $CONFIGFILE || echo -n "nginx already running" } do_stop() { kill -INT `cat $PIDFILE` || echo -n "nginx not running" } do_reload() { kill -HUP `cat $PIDFILE` || echo -n "nginx can't reload" } case "$1" in start) echo -n "Starting $DESC: $NAME" do_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" do_stop echo "." ;; reload|graceful) echo -n "Reloading $DESC configuration..." do_reload echo "." ;; restart) echo -n "Restarting $DESC: $NAME" do_stop do_start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2 exit 3 ;; esac exit 0 [[email protected] conf]# chmod 775 /etc/init.d/nginx [[email protected] conf]# service nginx restart [[email protected] conf]# vi /etc/rc.local /etc/init.d/nginx start View Code

    三、mysql 5.6.30

         安装

    彩世界平台 3[[email protected] ~]# cd /usr/local/src/ [[email protected]彩世界时时app, src]# yum -y install bison expat expat-devel ncurses ncurses-devel libaio libaio-devel libc.so.6 [[email protected] src]# wget [[email protected] src]# tar -xzf cmake-3.5.2.tar.gz [[email protected] src]# cd cmake-3.5.2 [[email protected] cmake-3.5.2]# ./configure [[email protected] cmake-3.5.2]# make [[email protected] cmake-3.5.2]# make install [[email protected] cmake-3.5.2]# cd ../ [[email protected] src]# wget [[email protected] src]# tar -xzf mysql-5.6.30.tar.gz [[email protected] mysql-5.6.30]# groupadd mysql [[email protected] mysql-5.6.30]# useradd -g mysql mysql -s /bin/false [[email protected] mysql-5.6.30]# mkdir -p /data/mysql [[email protected] mysql-5.6.30]# chown -R mysql.mysql /data/mysql [[email protected] mysql-5.6.30]# mkdir -p /usr/local/mysql-5.6.30 [[email protected] mysql-5.6.30]# chown -R mysql.mysql /usr/local/mysql-5.6.30 [[email protected] mysql-5.6.30]# yum -y install bison-devel ncurses-devel libaio libaio-devel [[email protected] mysql-5.6.30]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.30 -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/usr/local/mysql-5.6.30 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci [[email protected] mysql-5.6.30]# make [[email protected] mysql-5.6.30]# make install [[email protected] mysql-5.6.30]# chmod +x scripts/mysql_install_db [[email protected] mysql-5.6.30]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.6.30 --datadir=/data/mysql --explicit_defaults_for_timestamp [[email protected] mysql-5.6.30]# cd /usr/local/mysql-5.6.30/ [[email protected] mysql-5.6.30]# rm -f /etc/my.cnf ./my.cnf [[email protected] mysql-5.6.30]# cp support-files/my-default.cnf ./my.cnf [[email protected] mysql-5.6.30]# ln -s /usr/local/mysql-5.6.30/my.cnf /etc/my.cnf [[email protected] mysql-5.6.30]# vi my.cnf basedir=/usr/local/mysql-5.6.30 datadir=/data/mysql port =3306 pid-file=/data/logs/mysql.pid log_error = /data/logs/mysql_error.log slow_query_log = 1 long_query_time = 1 slow_query_log_file = /data/logs/mysql_slow.log [[email protected] mysql-5.6.30]# cp ./support-files/mysql.server /etc/init.d/mysql [[email protected] mysql-5.6.30]# chmod 775 /etc/init.d/mysql [[email protected] mysql-5.6.30]# /etc/init.d/mysql start Starting MySQL. SUCCESS! View Code

        初始化密码,允许远程连接及开机自启

    彩世界平台 4[[email protected] mysql-5.6.30]# vi /etc/profile export PATH=$PATH:/usr/local/mysql-5.6.30/bin [[email protected] mysql-5.6.30]# source /etc/profile [[email protected] mysql-5.6.30]# mysql -u root -p Enter password: #密码为空 mysql> SET PASSWORD = PASSWORD('123456'); Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM user WHERE Host!='%'; Query OK, 5 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye [[email protected] mysql-5.6.30]# vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT [[email protected] mysql-5.6.30]# service iptables restart [[email protected] mysql-5.6.30]# vi /etc/rc.local /etc/init.d/mysql start View Code

    四、php 5.6.21

         安装

    彩世界平台 5[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz [[email protected] src]# tar -xzf libmcrypt-2.5.7.tar.gz [[email protected] src]# cd libmcrypt-2.5.7 [[email protected] libmcrypt-2.5.7]# ./configure [[email protected] libmcrypt-2.5.7]# make [[email protected] libmcrypt-2.5.7]# make install [[email protected] libmcrypt-2.5.7]# ldconfig [[email protected] libmcrypt-2.5.7]# cd libltdl/ [[email protected] libltdl]# ./configure --enable-ltdl-install [[email protected] libltdl]# make [[email protected] libltdl]# make install [[email protected] libltdl]# cd ../../ [[email protected] src]# wget [[email protected] src]# tar -zxf mhash-0.9.9.9.tar.gz [[email protected] src]# cd mhash-0.9.9.9 [[email protected] mhash-0.9.9.9]# ./configure [[email protected] mhash-0.9.9.9]# make [[email protected] mhash-0.9.9.9]# make install [[email protected] mhash-0.9.9.9]# cd ../ [[email protected] src]# wget [[email protected] src]# tar -xzf mcrypt-2.6.8.tar.gz [[email protected] src]# cd mcrypt-2.6.8 [[email protected] mcrypt-2.6.8]# ./configure LD_LIBRARY_PATH=/usr/local/lib [[email protected] mcrypt-2.6.8]# make [[email protected] mcrypt-2.6.8]# make install [[email protected] mcrypt-2.6.8]# cd ../ [[email protected] src]# wget [[email protected] src]# rpm -ivh libzip-0.9-3.1.el6.x86_64.rpm [[email protected] src]# wget [[email protected] src]# tar -xzf php-5.6.21.tar.gz [[email protected] src]# cd php-5.6.21 [[email protected] php-5.6.21]# ./configure --prefix=/usr/local/php-5.6.21 --with-config-file-path=/usr/local/php-5.6.21/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=/usr/local/mysql-5.6.30/bin/mysql_config --with-pdo-mysql=/usr/local/mysql-5.6.30/bin/mysql_config --with-libxml-dir --enable-zip --with-zlib --with-zlib-dir --with-curl --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --with-xmlrpc --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir --enable-shared --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-pcntl --enable-sockets --enable-soap ... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no [[email protected] php-5.6.21]# cat /etc/ld.so.conf.d/mysql-x86_64.conf cat: /etc/ld.so.conf.d/mysql-x86_64.conf: No such file or directory [[email protected] php-5.6.21]# echo '/usr/local/lib' >> /etc/ld.so.conf.d/local.conf [[email protected] php-5.6.21]# echo '/usr/local/lib64' >> /etc/ld.so.conf.d/local.conf [[email protected] php-5.6.21]# cat /etc/ld.so.conf.d/mysql-x86_64.conf /usr/lib64/mysql [[email protected] php-5.6.21]# echo '/usr/local/mysql-5.6.30/lib' >> /etc/ld.so.conf.d/mysql-x86_64.conf [[email protected] php-5.6.21]# ldconfig [[email protected] php-5.6.21]# ./configure --prefix=/usr/local/php-5.6.21 --with-config-file-path=/usr/local/php-5.6.21/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=/usr/local/mysql-5.6.30/bin/mysql_config --with-pdo-mysql=/usr/local/mysql-5.6.30/bin/mysql_config --with-libxml-dir --enable-zip --with-zlib --with-zlib-dir --with-curl --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --with-xmlrpc --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir --enable-shared --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-pcntl --enable-sockets --enable-soap [[email protected] php-5.6.21]# make -j4 [[email protected] php-5.6.21]# make install [[email protected] php-5.6.21]# cd /usr/local/php-5.6.21/etc [[email protected] etc]# cp /usr/local/src/php-5.6.21/php.ini-development php.ini [[email protected] etc]# cp php-fpm.conf.default php-fpm.conf [[email protected] etc]# vi php-fpm.conf pid = /data/logs/php-fpm.pid error_log = /data/logs/php-fpm.log pm.max_children = 40 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 [[email protected] etc]# vi php.ini date.timezone = 'PRC' error_log = /data/logs/php_errors.log [[email protected] etc]# /usr/local/php-5.6.21/sbin/php-fpm [[email protected] etc]# ps -ef | grep fpm root 9516 1 0 15:52 ? 00:00:00 php-fpm: master process (/usr/local/php-5.6.21/etc/php-fpm.conf) www 9517 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9518 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9519 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9520 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9521 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9522 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9523 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9524 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9525 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9526 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9527 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9528 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9529 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9530 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9531 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9532 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9533 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9534 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9535 9516 0 15:52 ? 00:00:00 php-fpm: pool www www 9536 9516 0 15:52 ? 00:00:00 php-fpm: pool www root 9545 1666 0 15:54 pts/0 00:00:00 grep fpm [[email protected] etc]# /usr/local/php-5.6.21/bin/php -v PHP 5.6.21 (cli) (built: May 7 2016 15:29:00) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies View Code

         开机自启

    彩世界平台 6[[email protected] etc]# vi /etc/init.d/php-fpm #! /bin/sh php_fpm_BIN=/usr/local/php-5.6.21/sbin/php-fpm php_fpm_CONF=/usr/local/php-5.6.21/etc/php-fpm.conf php_fpm_PID=/data/logs/php-fpm.pid php_fpm_INI=/usr/local/php-5.6.21/etc/php.ini php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID -c $php_fpm_INI" wait_for_pid () { try=0 while test $try -lt 35 ; do case "$1" in 'created') if [ -f "$2" ] ; then try='' break fi ;; 'removed') if [ ! -f "$2" ] ; then try='' break fi ;; esac echo -n . try=`expr $try + 1` sleep 1 done } case "$1" in start) echo -n "Starting php-fpm " $php_fpm_BIN --daemonize $php_opts if [ "$?" != 0 ] ; then echo " failed" exit 1 fi wait_for_pid created $php_fpm_PID if [ -n "$try" ] ; then echo " failed" exit 1 else echo " done" fi ;; stop) echo -n "Gracefully shutting down php-fpm " if [ ! -r $php_fpm_PID ] ; then echo "warning, no pid file found - php-fpm is not running ?" exit 1 fi kill -QUIT `cat $php_fpm_PID` wait_for_pid removed $php_fpm_PID if [ -n "$try" ] ; then echo " failed. Use force-quit" exit 1 else echo " done" fi ;; status) if [ ! -r $php_fpm_PID ] ; then echo "php-fpm is stopped" exit 0 fi PID=`cat $php_fpm_PID` if ps -p $PID | grep -q $PID; then echo "php-fpm (pid $PID) is running..." else echo "php-fpm dead but pid file exists" fi ;; force-quit) echo -n "Terminating php-fpm " if [ ! -r $php_fpm_PID ] ; then echo "warning, no pid file found - php-fpm is not running ?" exit 1 fi kill -TERM `cat $php_fpm_PID` wait_for_pid removed $php_fpm_PID if [ -n "$try" ] ; then echo " failed" exit 1 else echo " done" fi ;; restart) $0 stop $0 start ;; reload) echo -n "Reload service php-fpm " if [ ! -r $php_fpm_PID ] ; then echo "warning, no pid file found - php-fpm is not running ?" exit 1 fi kill -USR2 `cat $php_fpm_PID` echo " done" ;; *) echo "Usage: $0 {start|stop|force-quit|restart|reload|status}" exit 1 ;; esac [[email protected] etc]# chmod 775 /etc/init.d/php-fpm [[email protected] etc]# service php-fpm restart Gracefully shutting down php-fpm . done Starting php-fpm done [[email protected] etc]# vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT [[email protected] etc]# service iptables restart [[email protected] etc]# vi /etc/rc.local /etc/init.d/php-fpm start View Code

    五、vhost

    彩世界平台 7[[email protected] etc]# cd /data/ [[email protected] data]# mkdir -p /data/www/test [[email protected] data]# vi /data/www/test/index.php <?php phpinfo(); [[email protected] data]# chown -R www.www /data/www [[email protected] data]# vi /usr/local/nginx-1.9.9/conf/vhost/test.conf server { listen 80; server_name www.test.dev; index index.html index.php; root /data/www/test; location ~ .*.php?$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; access_log off; } location ~ .*.(js|css)?$ { expires 12h; } #include rewrite/test.conf; #access_log /data/logs/nginx.test.access.log access; } [[email protected] data]# vi /usr/local/nginx-1.9.9/conf/fastcgi_params fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; [[email protected] data]# service nginx restart [[email protected] data]# echo '127.0.0.1 www.test.dev' >> /etc/hosts [[email protected] data]# curl | grep 'PHP Version 5.6.21' View Code

    六、extension

    彩世界平台 8[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# yum -y install git [[email protected] src]# git clone --depth=1 git://github.com/phalcon/cphalcon.git [[email protected] src]# cd cphalcon/build/ [[email protected] build]# vi ./install #phpize && ./configure --enable-phalcon && make && make install && echo -e "nThanks for compiling Phalcon!nBuild succeed: Please restart your web server to complete the installation" /usr/local/php-5.6.21/bin/phpize && ./configure --enable-phalcon --with-php-config=/usr/local/php-5.6.21/bin/php-config && make && make install && echo -e "nThanks for compiling Phalcon!nBuild succeed: Please restart your web server to complete the installation" [[email protected] build]# ./install [[email protected] build]# vi /usr/local/php-5.6.21/etc/php.ini extension_dir = "/usr/local/php-5.6.21/lib/php/extensions/no-debug-non-zts-20131226/" extension=phalcon.so [[email protected] build]# service php-fpm restart [[email protected] build]# /usr/local/php-5.6.21/bin/php -i |grep phalcon [[email protected] build]# cd ../../ [[email protected] src]# wget [[email protected] src]# tar -xzf libmemcached-1.0.18.tar.gz [[email protected] src]# cd libmemcached-1.0.18 [[email protected] libmemcached-1.0.18]# ./configure --prefix=/usr/local/libmemcached-1.0.18 [[email protected] libmemcached-1.0.18]# make [[email protected] libmemcached-1.0.18]# make install [[email protected] libmemcached-1.0.18]# cd ../ [[email protected] src]# wget [[email protected] src]# tar -xzf memcached-2.2.0.tgz [[email protected] src]# cd memcached-2.2.0 [[email protected] memcached-2.2.0]# /usr/local/php-5.6.21/bin/phpize [[email protected] memcached-2.2.0]# ./configure --enable-memcached --with-php-config=/usr/local/php-5.6.21/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached-1.0.18 ... checking sasl/sasl.h usability... no checking sasl/sasl.h presence... no checking for sasl/sasl.h... no configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check [[email protected] memcached-2.2.0]# yum -y install cyrus-sasl-devel [[email protected] memcached-2.2.0]# /usr/local/php-5.6.21/bin/phpize [[email protected] memcached-2.2.0]# ./configure --enable-memcached --disable-memcached-sasl --with-php-config=/usr/local/php-5.6.21/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached-1.0.18 [[email protected] memcached-2.2.0]# make [[email protected] memcached-2.2.0]# make install [[email protected] memcached-2.2.0]# vi /usr/local/php-5.6.21/etc/php.ini extension=memcached.so [[email protected] memcached-2.2.0]# service php-fpm restart [[email protected] memcached-2.2.0]# /usr/local/php-5.6.21/bin/php -i |grep memcached [[email protected] memcached-2.2.0]# cd ../ [[email protected] src]# wget [[email protected] src]# tar -xzf memcache-2.2.7.tgz [[email protected] src]# cd memcache-2.2.7 [[email protected] memcache-2.2.7]# /usr/local/php-5.6.21/bin/phpize [[email protected] memcache-2.2.7]# ./configure --with-php-config=/usr/local/php-5.6.21/bin/php-config [[email protected] memcache-2.2.7]# make [[email protected] memcache-2.2.7]# make install [[email protected] memcache-2.2.7]# vi /usr/local/php-5.6.21/etc/php.ini extension=memcache.so [[email protected] memcache-2.2.7]# service php-fpm restart [[email protected] memcache-2.2.7]# /usr/local/php-5.6.21/bin/php -i |grep memcache View Code

    七、memcached service

    彩世界平台 9[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# wget [[email protected] src]# tar -xzf libevent-2.0.21-stable.tar.gz [[email protected] src]# cd libevent-2.0.21-stable [[email protected] libevent-2.0.21-stable]# ./configure -prefix=/usr [[email protected] libevent-2.0.21-stable]# make [[email protected] libevent-2.0.21-stable]# make install [[email protected] libevent-2.0.21-stable]# ls -al /usr/lib | grep libevent [[email protected] libevent-2.0.21-stable]# cd ../ [[email protected] src]# wget [[email protected] src]# tar -xzf memcached-1.4.25.tar.gz [[email protected] src]# cd memcached-1.4.25 [[email protected] memcached-1.4.25]# ./configure -with-libevent=/usr [[email protected] memcached-1.4.25]# make CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /usr/local/src/memcached-1.4.25/missing aclocal-1.14 /usr/local/src/memcached-1.4.25/missing: line 81: aclocal-1.14: command not found WARNING: 'aclocal-1.14' is missing on your system. You should only need it if you modified 'acinclude.m4' or 'configure.ac' or m4 files included by 'configure.ac'. The 'aclocal' program is part of the GNU Automake package: <; It also requires GNU Autoconf, GNU m4 and Perl in order to run: <; <; <; make: *** [aclocal.m4] Error 127 [[email protected] memcached-1.4.25]# autoreconf -ivf [[email protected] memcached-1.4.25]# make [[email protected] memcached-1.4.25]# make install [[email protected] memcached-1.4.25]# ls -al /usr/local/bin/mem* [[email protected] memcached-1.4.25]# /usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 11211 -c 256 -P /data/logs/memcached.pid [[email protected] memcached-1.4.25]# vi /etc/init.d/memcached #! /bin/sh start() { echo -n $"Starting memcached" /usr/local/bin/memcached -d -m 10 -u root -l 127.0.0.1 -p 11211 -c 256 -P /data/logs/memcached.pid echo -e 'n' } stop() { echo -n $"Shutting down memcached" kill `cat /data/logs/memcached.pid` echo -e 'n' } [ -f /usr/local/bin/memcached ] || exit 0 case "$1" in start) start ;; stop) stop ;; restart|reload) stop start ;; condrestart) stop start ;; *) echo $"Usage: $0 {start|stop|restart|reload|condrestart}" exit 1 esac exit 0 [[email protected] memcached-1.4.25]# chmod 755 /etc/init.d/memcached [[email protected] memcached-1.4.25]# service memcached restart [[email protected] memcached-1.4.25]# vi /etc/rc.local /etc/init.d/memcached start View Code

     

    零、resource 一、centos 6.4、VirtualBox 5.0.14 二、nginx1.9.9 安装 [[email protected] ~]# cd /usr/loc...

    零、resource   

    一、centos 6.4、VirtualBox 5.0.14

    二、nginx 1.9.9

         安装

    彩世界平台 10彩世界平台 11

    [root@pc ~]# cd /usr/local/src/
    [root@pc src]# yum install wget
    [root@pc src]# wget http://heanet.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz
    [root@pc src]# tar -xzf pcre-8.38.tar.gz
    [root@pc src]# cd pcre-8.38/
    [root@pc pcre-8.38]# ./configure --prefix=/usr/local/pcre-8.38
    [root@pc pcre-8.38]# make
    [root@pc pcre-8.38]# make install
    [root@pc pcre-8.38]# cd ../
    [root@pc src]# yum -y install libjpeg libjpeg-devel libpng libpng-devel libvpx libvpx-devel libXpm libXpm-devel libxml2 libxml2-devel fontconfig fontconfig-devel freetype freetype-devel zlib zlib-devel bzip2 bzip2-devel curl curl-devel openssl openssl-devel
    [root@pc src]# groupadd www
    [root@pc src]# useradd -g www www
    [root@pc src]# passwd www
    [root@pc src]# wget http://nginx.org/download/nginx-1.9.9.tar.gz
    [root@pc src]# tar -xzf nginx-1.9.9.tar.gz 
    [root@pc src]# cd nginx-1.9.9/
    [root@pc nginx-1.9.9]# ./configure --prefix=/usr/local/nginx-1.9.9 --user=www --group=www --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.38
    [root@pc nginx-1.9.9]# make
    [root@pc nginx-1.9.9]# make install
    [root@pc nginx-1.9.9]# cd /usr/local/nginx-1.9.9/conf/
    [root@pc conf]# vi nginx.conf
        user  www;
        worker_processes  10;
        error_log  /data/logs/nginx_error.log;
        pid        /data/logs/nginx.pid;
        http {
            include vhost/*.conf;
        }
    [root@pc conf]# mkdir vhost rewrite
    [root@pc conf]# mkdir -p /data/logs/
    [root@pc conf]# chown -R www.www /data
    [root@pc conf]# chmod -R 777 /data
    [root@pc conf]# /usr/local/nginx-1.9.9/sbin/nginx -t
    nginx: the configuration file /usr/local/nginx-1.9.9/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx-1.9.9/conf/nginx.conf test is successful
    [root@pc conf]# /usr/local/nginx-1.9.9/sbin/nginx
    [root@pc nginx-1.9.9]# ps -ef | grep nginx
    root     14442     1  0 14:15 ?        00:00:00 nginx: master process /usr/local/nginx-1.9.9/sbin/nginx
    www      14457 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14458 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14459 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14460 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14461 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14462 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14463 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14464 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14465 14442  0 14:24 ?        00:00:00 nginx: worker process            
    www      14466 14442  0 14:24 ?        00:00:00 nginx: worker process            
    root     14472  1358  0 14:27 pts/0    00:00:00 grep nginx
    [root@pc conf]# curl http://localhost
    <!DOCTYPE html>
    <html>
    <head>
    <title>Welcome to nginx!</title>
    <style>
        body {
            width: 35em;
            margin: 0 auto;
            font-family: Tahoma, Verdana, Arial, sans-serif;
        }
    </style>
    </head>
    <body>
    <h1>Welcome to nginx!</h1>
    <p>If you see this page, the nginx web server is successfully installed and
    working. Further configuration is required.</p>
    
    <p>For online documentation and support please refer to
    <a href="http://nginx.org/">nginx.org</a>.<br/>
    Commercial support is available at
    <a href="http://nginx.com/">nginx.com</a>.</p>
    
    <p><em>Thank you for using nginx.</em></p>
    </body>
    </html>
    

    View Code

         开机自启

    彩世界平台 12彩世界平台 13

    [root@pc conf]# vi /etc/init.d/nginx
    #! /bin/sh
    DESC="nginx service"
    NAME=nginx
    DAEMON=//usr/local/nginx-1.9.9/sbin/$NAME
    CONFIGFILE=/usr/local/nginx-1.9.9/conf/$NAME.conf
    PIDFILE=/data/logs/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    set -e
    [ -x "$DAEMON" ] || exit 0
    do_start() {
        $DAEMON -c $CONFIGFILE || echo -n "nginx already running"
    }
    do_stop() {
        kill -INT `cat $PIDFILE` || echo -n "nginx not running"
    }
    do_reload() {
        kill -HUP `cat $PIDFILE` || echo -n "nginx can't reload"
    }
    case "$1" in
        start)
            echo -n "Starting $DESC: $NAME"
            do_start
            echo "."
            ;;
        stop)
            echo -n "Stopping $DESC: $NAME"
            do_stop
            echo "."
            ;;
        reload|graceful)
            echo -n "Reloading $DESC configuration..."
            do_reload
            echo "."
            ;;
        restart)
            echo -n "Restarting $DESC: $NAME"
            do_stop
            do_start
            echo "."
            ;;
        *)
            echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
            exit 3
            ;;
    esac
    exit 0
    [root@pc conf]# chmod 775 /etc/init.d/nginx
    [root@pc conf]# service nginx restart
    [root@pc conf]# vi /etc/rc.local
        /etc/init.d/nginx start
    

    View Code

    三、mysql 5.6.30

         安装

    彩世界平台 14彩世界平台 15

    [root@pc ~]# cd /usr/local/src/
    [root@pc src]# yum -y install bison expat expat-devel ncurses ncurses-devel libaio libaio-devel libc.so.6
    [root@pc src]# wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz
    [root@pc src]# tar -xzf cmake-3.5.2.tar.gz
    [root@pc src]# cd cmake-3.5.2
    [root@pc cmake-3.5.2]# ./configure
    [root@pc cmake-3.5.2]# make
    [root@pc cmake-3.5.2]# make install
    [root@pc cmake-3.5.2]#  cd ../
    [root@pc src]# wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.30.tar.gz
    [root@pc src]# tar -xzf mysql-5.6.30.tar.gz
    [root@pc mysql-5.6.30]# groupadd mysql
    [root@pc mysql-5.6.30]# useradd -g mysql mysql -s /bin/false
    [root@pc mysql-5.6.30]# mkdir -p /data/mysql
    [root@pc mysql-5.6.30]# chown -R mysql.mysql /data/mysql
    [root@pc mysql-5.6.30]# mkdir -p /usr/local/mysql-5.6.30
    [root@pc mysql-5.6.30]# chown -R mysql.mysql /usr/local/mysql-5.6.30
    [root@pc mysql-5.6.30]# yum -y install bison-devel ncurses-devel libaio libaio-devel
    [root@pc mysql-5.6.30]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.30 
    -DMYSQL_DATADIR=/data/mysql 
    -DSYSCONFDIR=/usr/local/mysql-5.6.30 
    -DWITH_MYISAM_STORAGE_ENGINE=1 
    -DWITH_INNOBASE_STORAGE_ENGINE=1 
    -DWITH_MEMORY_STORAGE_ENGINE=1 
    -DWITH_READLINE=1 
    -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock 
    -DMYSQL_TCP_PORT=3306 
    -DENABLED_LOCAL_INFILE=1 
    -DWITH_PARTITION_STORAGE_ENGINE=1 
    -DEXTRA_CHARSETS=all 
    -DDEFAULT_CHARSET=utf8 
    -DDEFAULT_COLLATION=utf8_general_ci
    [root@pc mysql-5.6.30]# make
    [root@pc mysql-5.6.30]# make install
    [root@pc mysql-5.6.30]# chmod +x scripts/mysql_install_db
    [root@pc mysql-5.6.30]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.6.30 --datadir=/data/mysql --explicit_defaults_for_timestamp
    [root@pc mysql-5.6.30]# cd /usr/local/mysql-5.6.30/
    [root@pc mysql-5.6.30]# rm -f /etc/my.cnf ./my.cnf
    [root@pc mysql-5.6.30]# cp support-files/my-default.cnf ./my.cnf
    [root@pc mysql-5.6.30]# ln -s /usr/local/mysql-5.6.30/my.cnf /etc/my.cnf
    [root@pc mysql-5.6.30]# vi my.cnf
        basedir=/usr/local/mysql-5.6.30
        datadir=/data/mysql
        port =3306
        pid-file=/data/logs/mysql.pid
        log_error = /data/logs/mysql_error.log
        slow_query_log = 1
        long_query_time = 1
        slow_query_log_file = /data/logs/mysql_slow.log
    [root@pc mysql-5.6.30]# cp ./support-files/mysql.server /etc/init.d/mysql
    [root@pc mysql-5.6.30]# chmod 775 /etc/init.d/mysql
    [root@pc mysql-5.6.30]# /etc/init.d/mysql start
    Starting MySQL. SUCCESS!
    

    View Code

        初始化密码,允许远程连接及开机自启

    彩世界平台 16彩世界平台 17

    [root@pc mysql-5.6.30]# vi /etc/profile
        export PATH=$PATH:/usr/local/mysql-5.6.30/bin
    [root@pc mysql-5.6.30]# source /etc/profile
    [root@pc mysql-5.6.30]# mysql -u root -p
    Enter password: #密码为空
    mysql> SET PASSWORD = PASSWORD('123456');
    Query OK, 0 rows affected (0.00 sec)
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
    Query OK, 0 rows affected (0.00 sec)
    mysql> DELETE FROM user WHERE Host!='%';
    Query OK, 5 rows affected (0.00 sec)
    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)
    mysql> exit
    Bye
    [root@pc mysql-5.6.30]# vi /etc/sysconfig/iptables
        -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
    [root@pc mysql-5.6.30]# service iptables restart
    [root@pc mysql-5.6.30]# vi /etc/rc.local
        /etc/init.d/mysql start
    

    View Code

    四、php 5.6.21

    本文由彩世界平台发布于彩世界开奖app苹果下载,转载请注明出处:LNMP意况搭建完整步骤,lnmp情状搭建

    关键词: