Linux 下 LAMP 环境搭建

来源:互联网 发布:广州多益网络官网 编辑:程序博客网 时间:2024/05/07 17:53

一、卸载旧版本:

1、卸载 Apache:yum erase httpd

2、卸载 PHP:yum erase php php-cli

3、卸载 MySQL:yum erase mysql

二、安装新版本:

1、安装 Apache:

tar -zxvf httpd-2.2.24.tar.gz

cd httpd-2.2.24

./configure --prefix=/opt/httpd --enable-so --enable-rewrite

make

make install

配置:cd /opt/httpd/conf/httpd.conf,修改 98 行 ServerName www.example.com:80 为 ServerName 127.0.0.1:80

启动:/opt/httpd/bin/httpd -k start | restart | stop

添加自启动:

cp /opt/httpd/bin/apachectl /etc/rc.d/init.d/httpd

打开 httpd 在 #!/bin/sh 下增加如下代码:

# chkconfig: 35 70 30

# descript: Apache

注册服务:chkconfig -add httpd | chkconfig --level 35 httpd on

2、安装 MySQL一般是通过 rpm 包来安装的

rpm -ivh MySQL-server-5.6.11-2.el6.x86_64.rpm

rpm -ivh MySQL-client-5.6.11-2.el6.x86_64.rpm

3、安装 PHP

yum install yum install libxml2 libxml2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel libtool-ltdl-devel


原创粉丝点击