日期:2011-12-24 12:57:00  来源:本站整理

<b>CentOS 6.0最小化编译安装Nginx+MySQL+PHP+Zend</b>[服务器安全]

赞助商链接



  本文“<b>CentOS 6.0最小化编译安装Nginx+MySQL+PHP+Zend</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
引言:
操作系统:CentOS 6.0 32位
下载地址:http://mirrors.163.com/centos/6.0/isos/i386/CentOS-6.0-i386-bin-DVD.iso
安装方法:采取最小化安装,在安装系统的时刻挑选Minimal(CentOS 6.0默许就是Minimal安装情势,不含有任何可选安装包)
最小化安装完成之后,系统占用900M左右磁盘空间
备注:操作系统的安装,这里就不演示了,假若有疑问可以参考相关教程
CentOS 6.0安装图解教程 http://wenku.百度.com/view/668f53e9e009581b6bd9ebc9.html
=================================================================================================================
安装前预备:

1、配置好ip dns 网关,确保利用远程衔接工具可以衔接服务器

2、关闭selinux
vi /etc/selinux/config 把SELINUX=enforcing SELINUXTYPE=targeted注释掉,然后新加一行为:SELINUX=disabled

3、开启防火墙呼应端口,apache需求开启80端口 MySQL需求开启3306端口
vi /etc/sysconfig/iptables
增添下面的内容
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #(答应80端口通过防火墙)
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #(答应3306端口通过防火墙)
重启防火墙使配置见效
/etc/init.d/iptables restart

4 、系统约定
软件源代码包存放位置:/usr/local/src
源码包编译安装位置:/usr/local/软件名字

5、下载软件


(1)下载pcre (支持nginx伪静态)
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz
(2)下载nginx(目前安定版)
http://nginx.org/download/nginx-1.0.6.tar.gz
(3)下载mysql
http://gd.tuwien.ac.at/db/mysql/Downloads/MySQL-5.1/mysql-5.1.59.tar.gz
(4)下载php
http://cn.php.net/distributions/php-5.2.17.tar.gz
(5)下载php-5.2.17-fpm (支持php FastCGI情势)
http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
(6)下载ZendOptimize
http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
(7)下载libmcrypt
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz #下载libmcrypt
(8)下载编译工具(要编译安装软件,必须先安装编译工具)
下载地址 http://mirror.centos.org/centos/6.0/os/i386/Packages/
大概直接从CentOS 6.0的安装光盘中复制出来,翻开安装光盘,在Packages文件夹下面,找到下面的安装包
kernel-headers-2.6.32-71.el6.i686.rpm
compat-glibc-headers-2.5-46.2.i686.rpm
compat-glibc-2.5-46.2.i686.rpm
compat-libstdc++-33-3.2.3-69.el6.i686.rpm
compat-libf2c-34-3.4.6-19.el6.i686.rpm
compat-libgcc-296-2.96-144.el6.i686.rpm
mpfr-2.4.1-6.el6.i686.rpm
cpp-4.4.4-13.el6.i686.rpm
glibc-headers-2.12-1.7.el6.i686.rpm
glibc-devel-2.12-1.7.el6.i686.rpm
libgomp-4.4.4-13.el6.i686.rpm
libstdc++-devel-4.4.4-13.el6.i686.rpm
ppl-0.10.2-11.el6.i686.rpm
cloog-ppl-0.15.7-1.2.el6.i686
gcc-4.4.4-13.el6.i686.rpm
compat-gcc-34-3.4.6-19.el6.i686.rpm
compat-gcc-34-c++-3.4.6-19.el6.i686.rpm
make-3.81-19.el6.i686.rpm
keyutils-libs-devel-1.4-1.el6.i686.rpm
libcom_err-devel-1.41.12-3.el6.i686.rpm
libsepol-devel-2.0.41-3.el6.i686.rpm
libselinux-devel-2.0.94-2.el6.i686.rpm
krb5-devel-1.8.2-3.el6.i686.rpm
zlib-devel-1.2.3-25.el6.i686.rpm
openssl-devel-1.0.0-4.el6.i686.rpm
libXpm-3.5.8-2.el6.i686.rpm
gd-2.0.35-10.el6.i686.rpm
freetype-2.3.11-5.el6.i686.rpm
libxml2-2.7.6-1.el6.i686.rpm
libxml2-devel-2.7.6-1.el6.i686.rpm
curl-7.19.7-16.el6.i686.rpm
libjpeg-devel-6b-46.el6.i686.rpm
libjpeg-6b-46.el6.i686.rpm
libjpeg-static-6b-46.el6.i686.rpm
libpng-1.2.44-1.el6.i686.rpm
libpng-devel-1.2.44-1.el6.i686.rpm
libpng-static-1.2.44-1.el6.i686.rpm
php-common-5.3.2-6.el6.i686.rpm
php-gd-5.3.2-6.el6.i686.rpm
gcc-c++-4.4.4-13.el6.i686.rpm
ncurses-devel-5.7-3.20090208.el6.i686.rpm
ncurses-term-5.7-3.20090208.el6.i686.rpm
ncurses-static-5.7-3.20090208.el6.i686.rpm
perl-Pod-Escapes-1.04-115.el6.i686.rpm
perl-libs-5.10.1-115.el6.i686.rpm
perl-version-0.77-115.el6.i686.rpm
perl-Module-Pluggable-3.90-115.el6.i686.rpm
perl-Pod-Simple-3.13-115.el6.i686.rpm
perl-5.10.1-115.el6.i686.rpm
autoconf213-2.13-20.1.el6.noarch.rpm
autoconf-2.63-5.1.el6.noarch.rpm
automake-1.11.1-1.2.el6.noarch.rpm
automake14-1.4p6-19.2.el6.noarch.rpm
automake16-1.6.3-18.el6.1.noarch.rpm
libtool-ltdl-2.2.6-15.5.el6.i686.rpm
libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm
libtool-2.2.6-15.5.el6.i686.rpm
patch-2.6-6.el6.i686.rpm

把这些安装包用WinSCP远程衔接工具上传到服务器的/usr/local/src下面
到此,安装前预备工作完成,

注意:这里我们是把软件下载好之后,再通过远程衔接工具上传到服务器上面的.
因为最小化安装完系统之后是不带wget号令的,所以无法直接从服务器下载,
当然,不倡议直接在服务器上面下载软件.
==============================================================
正式安装开始

以下是用putty工具远程登录到服务器,在终端号令行下面操作的

1、安装编译工具
cd /usr/local/src #进入软件包存放目录

按照以下次序举行安装,分外注意:次序一定不能错,不然安装失利

小本领:可以把下面的全部行按次序一次性复制到终端号令行,
系统会自动安装的,这样会节俭很对时刻,同时也避免操作错误!
####################################################################
rpm -ivh kernel-headers-2.6.32-71.el6.i686.rpm
rpm -ivh compat-glibc-headers-2.5-46.2.i686.rpm
rpm -ivh compat-glibc-2.5-46.2.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
rpm -ivh compat-libf2c-34-3.4.6-19.el6.i686.rpm
rpm -ivh compat-libgcc-296-2.96-144.el6.i686.rpm
rpm -ivh mpfr-2.4.1-6.el6.i686.rpm
rpm -ivh cpp-4.4.4-13.el6.i686.rpm
rpm -ivh glibc-headers-2.12-1.7.el6.i686.rpm
rpm -ivh glibc-devel-2.12-1.7.el6.i686.rpm
rpm -ivh libgomp-4.4.4-13.el6.i686.rpm
rpm -ivh libstdc++-devel-4.4.4-13.el6.i686.rpm
rpm -ivh ppl-0.10.2-11.el6.i686.rpm
rpm -ivh cloog-ppl-0.15.7-1.2.el6.i686.rpm
rpm -ivh gcc-4.4.4-13.el6.i686.rpm
rpm -ivh compat-gcc-34-3.4.6-19.el6.i686.rpm
rpm -ivh compat-gcc-34-c++-3.4.6-19.el6.i686.rpm
rpm -ivh make-3.81-19.el6.i686.rpm
rpm -ivh keyutils-libs-devel-1.4-1.el6.i686.rpm
rpm -ivh libcom_err-devel-1.41.12-3.el6.i686.rpm
rpm -ivh libsepol-devel-2.0.41-3.el6.i686.rpm
rpm -ivh libselinux-devel-2.0.94-2.el6.i686.rpm
rpm -ivh krb5-devel-1.8.2-3.el6.i686.rpm
rpm -ivh zlib-devel-1.2.3-25.el6.i686.rpm
rpm -ivh openssl-devel-1.0.0-4.el6.i686.rpm
rpm -ivh libXpm-3.5.8-2.el6.i686.rpm
rpm -ivh gd-2.0.35-10.el6.i686.rpm
rpm -ivh freetype-2.3.11-5.el6.i686.rpm
rpm -ivh libxml2-2.7.6-1.el6.i686.rpm
rpm -ivh libxml2-devel-2.7.6-1.el6.i686.rpm
rpm -ivh curl-7.19.7-16.el6.i686.rpm
rpm -ivh libjpeg-devel-6b-46.el6.i686.rpm
rpm -ivh libjpeg-6b-46.el6.i686.rpm
rpm -ivh libjpeg-static-6b-46.el6.i686.rpm
rpm -ivh libpng-1.2.44-1.el6.i686.rpm
rpm -ivh libpng-devel-1.2.44-1.el6.i686.rpm
rpm -ivh libpng-static-1.2.44-1.el6.i686.rpm
rpm -ivh php-common-5.3.2-6.el6.i686.rpm
rpm -ivh php-gd-5.3.2-6.el6.i686.rpm
rpm -ivh gcc-c++-4.4.4-13.el6.i686.rpm
rpm -ivh ncurses-devel-5.7-3.20090208.el6.i686.rpm
rpm -ivh ncurses-term-5.7-3.20090208.el6.i686.rpm
rpm -ivh ncurses-static-5.7-3.20090208.el6.i686.rpm
rpm -ivh --nodeps perl-Pod-Escapes-1.04-115.el6.i686.rpm
rpm -ivh --nodeps perl-libs-5.10.1-115.el6.i686.rpm
rpm -ivh --nodeps perl-version-0.77-115.el6.i686.rpm
rpm -ivh --nodeps perl-Module-Pluggable-3.90-115.el6.i686.rpm
rpm -ivh --nodeps perl-Pod-Simple-3.13-115.el6.i686.rpm
rpm -ivh --nodeps perl-5.10.1-115.el6.i686.rpm
rpm -ivh autoconf213-2.13-20.1.el6.noarch.rpm
rpm -ivh autoconf-2.63-5.1.el6.noarch.rpm
rpm -ivh automake-1.11.1-1.2.el6.noarch.rpm
rpm -ivh automake14-1.4p6-19.2.el6.noarch.rpm
rpm -ivh automake16-1.6.3-18.el6.1.noarch.rpm
rpm -ivh libtool-ltdl-2.2.6-15.5.el6.i686.rpm
rpm -ivh libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm
rpm -ivh libtool-2.2.6-15.5.el6.i686.rpm
rpm -ivh patch-2.6-6.el6.i686.rpm

#####################################################
=======================================================================================================================
2、安装mysql


cd /usr/local/src
tar zxvf mysql-5.1.59.tar.gz
cd mysql-5.1.59
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data/ --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/tmp/mysql.sock --with-shared --without-debug --with-extra-charsets=all --without-embedded-server --enable-profiling --enable-assembler --enable-thread-safe-client --with-server-suffix=-community --with-extra-charset=utf8,gbk
make
make install

分外注意:在履行make install编译的历程中,假如你看到屏幕上呈现下面这一行,卡在那边,好久都过不去,千万别认为是编译错误了,大概服务器卡住了,只需求保持,耐烦的等候几分钟,就会编译成功!Mysql编译安装奉告我们,任何事情,只要保持下去,终会成功!

make[4]: Entering directory `/usr/local/src/mysql-5.1.59/mysql-test'

groupadd mysql #增添mysql组
useradd -g mysql mysql -s /bin/false #成立用户mysql并加入到mysql组,不答应mysql用户直接登录系统
chown -R root /usr/local/mysql/ #答应root拜候
chgrp -R mysql /usr/local/mysql/ #答应mysql组拜候

cd /usr/local/mysql/ #进入mysql安装目录
cp share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件(注意:/etc目录下面默许有一个my.cnf,直接覆盖便可)
cp share/mysql/mysql.server /etc/init.d/mysqld #把Mysql加入系统启动
chmod 755 /etc/init.d/mysqld #履行权限

vi /etc/profile #把mysql服务加入系统环境变量
  以上是“<b>CentOS 6.0最小化编译安装Nginx+MySQL+PHP+Zend</b>[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
  • <b>hosts是什么 hosts文件在什么位置 若何改正hosts</b>
  • <b>在 Windows 8 中手动安装语言包</b>
  • <b>五个常见 PHP数据库问题</b>
  • Windows中Alt键的12个高效快速的利用本领介绍
  • <b>MySQL ORDER BY 的实现解析</b>
  • <b>详解MySQL存储历程参数有三种范例(in、out、inout)</b>
  • <b>Win8系统恢复出来经典的开始菜单的办法</b>
  • <b>Win8系统花屏怎么办 Win8系统花屏的办理办法</b>
  • <b>Windows 7系统下无线网卡安装</b>
  • <b>为什么 Linux不需求碎片整理</b>
  • <b>Windows 8中删除账户的几种办法(图)</b>
  • <b>教你如安在win7下配置路由器</b>
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .