您的位置:首页 > 博客中心 > 数据库 >

Cent OS 6.5 LAMP(Apache+php+mysql+Xcache) 编译安装

时间:2022-03-13 22:35

详细编译安装LAMP环境

安装OS及软件版本

    OS:Cent OS 6.5

    apache:httpd-2.4.10.tar.gz

    php:php-5.4.31.tar.bz2

    mysql:mysql-5.6.19.tar.gz

    Xcache:xcache-3.1.0.tar.gz

一、安装前准备

修改主机名 

   [root@linux ~]#sed -i ‘s/HOSTNAME=localhost.localdomain/HOSTNAME=linux.lamp.com/g‘ /etc/sysconfig/network 
   [root@linux ~]#vim /etc/hosts 
   127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
   ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
   10.0.20.203 linux linux.topgloira.com.cn

关闭selinux

 

   [root@linux ~]#sed -i ‘s@SELINUX=enforcing@SELINUX=disabled@g‘ /etc/sysconfig/selinux

设置防火墙,允许httpd:80和mysqld:3306端口访问 

   [root@linux ~]#vim /etc/sysconfig/iptables
   -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT    
   -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

二、安装Apache

首先创建一个YUM仓库

  1.下载64位rpmforge的rpm包     

[root@linux ~]#wget

  2.安装DAG的PGP Key

[root@linux ~]#rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

  3.验证rpmforge的rpm文件包

[root@linux ~]#rpm -K rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm 
 rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm: (sha1) dsa sha1 md5 gpg OK

  4.安装rpmforge的rpm文件包

[root@linux ~]#rpm -i rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

  5.编辑自己服务器的YUM仓库

[root@linux ~]#vim /etc/yum.repos.d/rpmforge.repo
[rpmforge]
name=CentOS-6.5_X86-64_rpmforge
baseurl=http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/
baseurlextra=http://apt.sw.be/redhat/el6/en/x86_64/extras/
mirrorlist=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
mirrotextras=http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras
enbaled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck=1

[root@linux ~]#yum repolist
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * rpmforge: ftp.riken.jp
base                                                     | 3.7 kB     00:00     
rpmforge                                                 | 1.9 kB     00:00     
rpmforge/primary_db                                      | 2.7 MB     00:02     
15 packages excluded due to repository priority protections
repo id                    repo name                                    status
base                       CentOS-6.5_X86-64_sohu                       6,352+15
rpmforge                   CentOS-6.5_X86-64_rpmforge                      4,718
repolist: 11,070

本文出自 “” 博客,转载请与作者联系!

Cent OS 6.5 LAMP(Apache+php+mysql+Xcache) 编译安装,布布扣,bubuko.com

热门排行

今日推荐

热门手游