zoukankan      html  css  js  c++  java
  • centos源码安装lnmp

    参考博客:http://blog.csdn.net/yanzi1225627/article/details/49123659

    服务器环境为:CentOS6.6 64位(虚拟机)

    一.安装前准备

    创建www目录,在www目录下创建software目录用来存储软件安装包

    二.安装所有的依赖包

    yum -y install ntp make openssl openssl-devel pcre pcre-devel libpng libpng-devel libjpeg-6b libjpeg-devel-6b freetype freetype-devel gd gd-devel zlib zlib-devel gcc gcc-c++ libXpm libXpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf automake screen sysstat compat-libstdc++-33 curl curl-devel cmake

    三.下载软件包

    1.nginx:http://nginx.org/en/download.html 下载稳定版 nginx-1.10.3.tar.gz

    2.mysql:http://dev.mysql.com/downloads/mysql/ 下载 mysql-5.5.54-linux2.6-x86_64.tar.gz

    3.php:http://php.net/downloads.php 下载php-5.6.30.tar.gz

    上传到 /www/software目录下

    四.安装nginx

    在/www/software目录下

    1.tar -zxvf nginx-1.10.3.tar.gz

    2.cd nginx-1.10.3

    3../configure --user=www --group=www --prefix=/www/nginx

    4.make

    5.make install

    6.groupadd -f www

    7.useradd -g www www

    8. cp /www/nginx/sbin/nginx /etc/init.d/

    9. chmod 755 /etc/init.d/nginx

    10.cd /etc/rc.d/init.d

    11.新建nginx,如果有则覆盖,文件内容如下

    #!/bin/bash
    # nginx Startup script for the Nginx HTTP Server
    # it is v.0.0.2 version.
    # chkconfig: - 85 15
    # description: Nginx is a high-performance web and proxy server.
    # It has a lot of features, but it's not for everyone.
    # processname: nginx
    # pidfile: /var/run/nginx.pid
    # config: /usr/local/nginx/conf/nginx.conf
    nginxd=/www/nginx/sbin/nginx
    nginx_config=/www/nginx/conf/nginx.conf
    nginx_pid=/www/nginx/logs/nginx.pid
    RETVAL=0
    prog="nginx"
    # Source function library.
    . /etc/rc.d/init.d/functions
    # Source networking configuration.
    . /etc/sysconfig/network
    # Check that networking is up.
    [ ${NETWORKING} = "no" ] && exit 0
    [ -x $nginxd ] || exit 0
    # Start nginx daemons functions.
    start() {
    if [ -e $nginx_pid ];then
    echo "nginx already running...."
    exit 1
    fi
    echo -n $"Starting $prog: "
    daemon $nginxd -c ${nginx_config}
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
    return $RETVAL
    }
    # Stop nginx daemons functions.
    stop() {
    echo -n $"Stopping $prog: "
    killproc $nginxd
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /www/nginx/logs/nginx.pid
    }
    reload() {
    echo -n $"Reloading $prog: "
    #kill -HUP `cat ${nginx_pid}`
    killproc $nginxd -HUP
    RETVAL=$?
    echo
    }
    # See how we were called.
    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    reload)
    reload
    ;;
    restart)
    stop
    start
    ;;
    status)
    status $prog
    RETVAL=$?
    ;;
    *)
    echo $"Usage: $prog {start|stop|restart|reload|status|help}"
    exit 1
    esac
    exit $RETVAL

    12.chmod 775 /etc/rc.d/init.d/nginx

    13.chkconfig nginx on 

    14./etc/rc.d/init.d/nginx restart

    15.service nginx restart

    16.在浏览器中树localhost,显示

    Welcome to nginx!

    五.安装mysql

    参考http://www.cnblogs.com/shiwaitaoyuan/p/6401334.html

    六. 安装php

    1. tar -zxvf  php-5.6.30.tar.gz

    2. cd php-5.6.30

    ./configure --prefix=/www/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-openssl --with-libxml-dir --with-zlib --enable-mbstring --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mysqlnd --with-pdo-mysql=/usr/local/mysql --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --with-curl

    3.make 和make install

    4.nginx整合php

    打开/www/nginx/conf/nginx.conf,做如下修改

    进到cp /www/php/etc/php-fpm.conf.default /www/php/etc/php-fpm.conf。

    执行/www/php/sbin/php-fpm

    5.配置php.ini 

    cp /root/www/software/php-5.6.30/php.ini-production /www/php/lib/。

  • 相关阅读:
    BZOJ 3527: [Zjoi2014]力 [快速傅里叶变换]
    BZOJ 2194 [快速傅里叶变换 卷积]
    BZOJ 2179 [快速傅里叶变换 高精度乘法]
    [快速傅立叶变换&快速傅里叶变换]【旧 手写笔记】
    CF 235C. Cyclical Quest [后缀自动机]
    BZOJ 1396&&2865 识别子串[后缀自动机 线段树]
    BZOJ 2780: [Spoj]8093 Sevenk Love Oimaster [广义后缀自动机]
    BZOJ 3926: [Zjoi2015]诸神眷顾的幻想乡 [广义后缀自动机 Trie]
    BZOJ 2806: [Ctsc2012]Cheat [广义后缀自动机 单调队列优化DP 二分]
    BZOJ 3473: 字符串 [广义后缀自动机]
  • 原文地址:https://www.cnblogs.com/shiwaitaoyuan/p/6420074.html
Copyright © 2011-2022 走看看