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

CentOS 6.0 最小化编译安装Apache+MySQL+PHP+Zend[服务器安全]

赞助商链接



  本文“CentOS 6.0 最小化编译安装Apache+MySQL+PHP+Zend[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
引言:
操作系统: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、下载软件
http://apache.etoak.com//httpd/httpd-2.2.21.tar.gz #下载apache
http://gd.tuwien.ac.at/db/mysql/Downloads/MySQL-5.1/mysql-5.1.59-linux-i686-glibc23.tar.gz #下载mysql
http://cn.php.net/distributions/php-5.2.17.tar.gz #下载php
http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz #下载ZendOptimize
http://www.cpan.org/src/5.0/perl-5.14.1.tar.gz #下载perl
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz #下载libmcrypt
用WinSCP远程衔接到服务器,把下载好的软件上传到服务器/usr/local/src下面.

6、下载编译工具(要编译安装软件,必须先安装编译工具)
下载地址 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、安装libmcrypt
cd /usr/local/src
tar zxvf libmcrypt-2.5.7.tar.gz #解压
cd libmcrypt-2.5.7 #进入目录
./configure #配置
make #编译
make install #安装

========================================
3、安装perl
cd /usr/local/src
tar zxvf perl-5.14.1.tar.gz
cd perl-5.14.1
./Configure -des -Dprefix=/usr/local/perl
make
make install

=======================================

4、安装MySQL
cd /usr/local/src
tar zxvf mysql-5.1.59-linux-i686-glibc23.tar.gz #解压
cp -r mysql-5.1.59-linux-i686-glibc23 /usr/local/ #复制文件夹到/usr/local/目录下面
cd /usr/local #进入/usr/local目录
mv mysql-5.1.59-linux-i686-glibc23 mysql #把文件夹mysql-5.1.59-linux-i686-glibc23改名为mysql

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组拜候

cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld #把Mysql加入系统启动
chmod 755 /etc/init.d/mysqld #履行权限
cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf #拷贝配置文件(注意:/etc目录下面默许有一个my.cnf,直接覆盖便可)
大概服务器有4G以上内存,用下面的这行
cp /usr/local/mysql/support-files/my-innodb-heavy-4G.ini /etc/my.cnf #拷贝配置文件(注意:/etc目录下面默许有一个my.cnf,直接覆盖便可)

cd /usr/local/mysql/
./scripts/mysql_install_db --user=mysql& #生成mysql系统数据库
./bin/mysqld_safe --user=mysql& #开启MySQL服务

vi /etc/profile #把mysql服务加入系统环境变量
  以上是“CentOS 6.0 最小化编译安装Apache+MySQL+PHP+Zend[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
  • Windows 2008R2 HyperV下安装CentOS6,网卡无痛设置
  • CentOS 6.x 利用安装光盘作为yum源
  • CentOS 下 Nginx + Keepalived 配置高可用Web站点
  • CentOS 5.8布置web缓存服务器(squid+memcached)
  • centos6.2改正yum的源为安装光盘
  • CentOS6 yum搭建Linux+Nginx+PHP+MYSQL(LNMP)
  • CentOS 6.2 安装Nginx并设置为开机服务
  • CentOS 6.2布置DNS
  • CentOS6.2利用yum安装LAMP及phpMyadmin
  • CentOS下配置PHP+phpMyAdmin
  • centos下mysql主从同步快速设置步骤分享
  • 在Windows主机上按时备份远程VPS(CentOS)数据的批处理
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

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

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