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

Linux环境的AMP安装--APACHE安装

2010-02-01 11:04 316 查看
2、APACHE的安装

1)当然还是下载源码包,如:httpd-2.0.55.tar.gz,地址自己找……

2)解压缩,>tar -zxvf httpd-2.0.55.tar.gz

3)进入解压后的httpd-2.0.55,>cd httpd-2.0.55

4)安装配置,>./configure --prefix=/opt/apache --enable-cgi

5)编译,>make

6)安装,>make install

7)启动,>/opt/apache/bin/apachectl start (restart 重启,stop停止)

现在打开浏览器,输入http://localhost,即可看到apache的欢迎界面。

注:

1)apache配置文件的修改,路径:/opt/apache/conf/httpd.conf,修改完配置文件记得重启apache

*修改默认首页:DirectoryIndex index.html index.html,改为:DirectoryIndex index.html index.html index.php

*添加执行PHP文件:AddType application/x-httpd-php .php

*修改默认编码:AddDefaultCharset utf-8

2)apache建立虚拟机

NameVirtualHost *:80

<VirtualHost *:80>

ServerName test.test.com

DocumentRoot /opt/htdocs/test

</VirtualHost>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: