zoukankan      html  css  js  c++  java
  • Centos5.4+Nginx+mysql5+php5+Zend3.3.3详细安装教程(转载请注明formating编写)

    转载请注明formating编写,感谢合作。软件我有soft.tar.gz包需要请联系 QQ:85908819,其实内容里也写了版本号,可以去官方下载。在文章里请注意iptables部分 SElinux部分为禁止 同时请确认您的gcc; c++; g++; libxml2; bzip2-libs; bzip2-devel; ncurses-devel; pear-devel等软件已经安装。否则安装出错,出错后不要着急,请到google和baidu搜索出错原因就是error后面部分。

    配置LNMP环境
    Centos5.4 + nginx-0.7.63 + mysql-5.0.51b.tar.gz + php-5.2.10.tar.gz + ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz环境

    =============================软件版本==========================
    软件版本:nginx-0.7.63 mysql5.0.51b php5.2.10 zend3.3.3 gd2.2
    ============================系统文件系统=======================
    swap
    /opt
    /
    ============================保留的系统=======================
    Atd; Crond; Irqblance; Microcode_ctl; network; Sendmail; sshd; syslog
    ============================Yum 更新列表=======================
    1.       Wget http://centos.ustc.edu.cn/CentOS-Base.repo
    2.       cp CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
    3.       rpm--import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
    4.       yum grouplist
    5.       yum groupinstall "Development Tools"
    6.       安装所需的软件用Yum install xxxxxx
    ================================增加目录======================
    /data
    /www
    /opt/bak/sql
    ===============================文件系统作用===================
    /Data:       mysql安装文件夹数据文件夹
    /www:      web文件以及相册文件存放文件夹
    /opt:         nginx gd php安装文件夹
    Php.ini       /opt/cgi
    /opt/bak/sql 数据库备份文件存储位置
    ===============================编译安装过程====================

    groupadd mysql       \\建立mysql用户组
    useradd -g mysql mysql \\增加mysql用户到mysql

    ==============安装MYSQL5步骤==================================
    cd ..
    tar -zxvf mysql-5.0.51b.tar.gz
    cd mysql-5.0.51b
    ./configure --prefix="/data/mysql5" --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysql-user=mysql --without-debug --with-socket-path="/data/mysql5/var/mysql.sock" --with-big-tables --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-innodb --without-ndb-debug --without-isam --enable-local-infile --with-readline --with-raid
    make
    make install
    cd /data/mysql5
    chown -R mysql .
    chgrp -R mysql .
    bin/mysql_install_db --user=mysql
    chown -R root .
    chown -R mysql var
    cp share/mysql/my-medium.cnf /etc/my.cnf
    cp share/mysql/mysql.server /etc/init.d/mysqld
    chmod 755 /etc/init.d/mysqld
    chkconfig --add mysqld
    chkconfig --level 3 mysqld on
    ===============================================================================
    ===============安装Nginx步骤======================
    tar zxvf nginx-0.7.63.tar.gz
    cd nginx-0.7.63
    ./configure --prefix=/opt/nginx --conf-path=/opt/nginx/conf/nginx.conf –with-http_realip_module –with-http_addition_module --with-http_gzip_static_module --with-http_random_index_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_module
    make
    make install
    cp /soft/conffile/nginx /etc/init.d/nginx
    chmod 755 /etc/init.d/nginx
    chkconfig --add nginx
    chkconfig nginx on
    =======================================================================================================
    ========================安装libpng jpegsrc freetype zlib步骤===================
    先安装zlib,freetype,libpng,jpeg,再装GD
    1.zlib
    tar zxvf zlib-1.2.2.tar.gz
    cd zlib-1.2.2
    ./configure
    make
    make install
    2.安装libpng
    tar zxvf libpng-1.2.7.tar.tar
    cd libpng-1.2.7
    cd scripts/
    mv makefile.linux ../makefile
    cd ..
    make
    make install
    注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个
    3.安装freetype
    tar zxvf freetype-2.1.9.tar.gz
    cd freetype-2.1.9
    ./configure
    Make
    make install
    4.安装Jpeg
    tar zxvf jpegsrc.v6b.tar.gz
    cd jpeg-6b/
    ./configure enable-shared
    Make
    make test
    make install
    #可能出错,一般为目录不存在,建立一个目录即可。注意,这里configure一定要带–enable-shared参数,不然,不会生成共享库
    5.安装GD
    tar zxvf gd-2.0.33.tar.gz
    cd gd-2.0.33
    ./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype
    make
    make install
    =======================================================================================================
    =========================安装php5步骤====================================
    cd ..
    tar zxvf php-5.2.10.tar.gz
    gzip -cd php-5.2.10-fpm-0.5.13.diff.gz | patch -d php-5.2.10 -p1
    cd php-5.2.10
    ./configure --prefix=/opt/php5 --with-config-file-path=/opt/etc/cgi --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --enable-magic-quotes --with-mysql=/data/mysql5 --with-pear --enable-sockets --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib --enable-sysvsem --enable-sysvshm --with-libxml-dir=/usr --enable-force-cgi-redirect --enable-fastcgi --with-xmlrpc --enable-zip --enable-fpm
    \\如果装gd时出现了 freetype no的时候./configure就不能编译 --with-freetype-dir
    Make
    Make test
    make install
    mkdir -p /opt/etc/cgi/
    cp php.ini-dist /opt/etc/cgi/php.ini
    mv -f /soft/conffile/php-fpm.conf /opt/php5/etc/php-fpm.conf
    groupadd www
    useradd -g www www
    echo 'ulimit -SHn 65535' >> /etc/rc.local
    echo '/opt/php5/sbin/php-fpm start' >> /etc/rc.local
    =======================================================================================================
    =========================安装Zend3.3.3步骤====================================
    tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
    cd ZendOptimizer-3.3.3-linux-glibc23-i386
    ./install
    (注意第一个要填的路径是Zend安装路径,第二个是php.ini所在的路径,即/opt/etc/cgi)
    (不要选重启apache)
    =======================================================================================================
    =========================启动Nginxphp=====================================
    mv -f /soft/conffile/fcgi.conf /opt/nginx/conf/
    cp -f /soft/conffile/nginx.conf /opt/nginx/conf/nginx.conf
    mkdir -p /home/www/wwwroot
    ulimit -SHn 65535
    /opt/php5/sbin/php-fpm start
    service nginx start
    /home/www/wwwroot放入一个index.php,如不想设置目录为/home/www/wwroot
    则可以在nginx.conf里更改路径
    启动后使用netstat –anp|more 观察是否有900080端口存在,有则正常。
    停止服务可以直接killall php-cgi和使用service nginx stop.
    =======================================================================================================
    ====================================数据备份脚本===========================
    #!/bin/bash
    #
    service mysqld stop
    date '+tar -zcvf /opt/bak/sql/data.%Y-%m-%d.tar.gz /opt/mysql5/var' | sh
    service mysqld start

    cron –e
    增加
    0 1 * * * /opt/sqlbak.sh
    Wq!
    在计划任务里,每天凌晨1点对数据库进行备份
    =======================================================================================================
    ==============================httpd随系统启动==============================
    /etc/rc.local里增加 service nginx start

  • 相关阅读:
    安装和使用 PyInstaller 遇到的问题
    Mininet 系列实验(七)
    Mininet 系列实验(六)
    Mininet 系列实验(五)
    Mininet 系列实验(三)
    Mininet 系列实验(一)
    Linux进程间通信(消息队列/信号量+共享内存)
    bugku 输入密码查看flag
    bugku 头等舱
    bugku 你必须让他停下
  • 原文地址:https://www.cnblogs.com/myphoebe/p/2622777.html
Copyright © 2011-2022 走看看