您的位置:首页 > 运维架构 > Apache

centos5 安装APACHE,php,mysql

2010-07-02 11:58 190 查看
一,安装httpd-2.2.3包

1、 需要两个关联文件 libapr-1.so ,libaprutil-1.so

1)可以通过yum httpd install 来安装

2) 手动安装包,apr和apr-util的apm包,apr属于apr-1.2.7-11.i386.rpm ,apr-util属于postgresql-libs-8.1.9-1.el5.i386.rpm apr-util-1.2.7-7.el5.i386.rpm

安装完以上几个包就可以安装httpd包了。

2,启动httpd服务

1) 手动启动 service httpd start

2) 自动启动

打开vim /etc/rc.d/rc.local 文件,在最后添加一行 /etc/rc.d/init.d/httpd restart 或者写httpd 的安装好的绝对路径。

3,设置网页的初始路径 DocumentRoot。

4,写一个index.html 看一下效果。

5,完成安装。

二,安装PHP5.2.3

1) 安装httpd-devel-2..开发包

2) 安装libxml2 包,下载地址:http://xmlsoft.org/downloads.html 或者光盘自动libxml2-...

3) ./configure --with-apxs2=/usr/sbin/apxs --prefix=/opt/php5/ --with-config-file-path=/etc

4) make && make install

5) apache 配置文件中添加 AddType application/x-httpd-php .php .phtml

如果重启apache 报Cannot load /usr/lib/httpd/modules/libphp5.so , cannot restore segment prot after reloc: Permission denied 类似这样的错误,执行下列语句:

chcon -t texrel_shlib_t libphp5.so 或者关闭 vim /etc/selinux/config SELINUX=enforcing 选项
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: