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

Linux 下 安装 Apache 的详细过程以及安装步骤

2012-12-18 16:51 615 查看
1.       上传apache安装文件httpd-2.2.8.tar.bz2(我用的是这个版本)

目录为/usr/local

2.       解压缩文件

  tar jvxf httpd-2.2.8.tar.bz2

3.       配置apache

cd httpd-2.2.8

./configure --prefix=/usr/local/apache/--enable-mods-shared=all --enable-so --enable-suexec --enable-rewrite(红色部分为安装路径)   后面的为备注

4.       编译apache

make

make install

5.       配置vhost

打开/usr/local/apache/conf/httpd.conf

首先检查配置文件中“LoadModule vhost_alias_module modules/mod_vhost_alias.so”已经存在,并且没有被注释,然后将以下内容加入到配置文件最后

 

UseCanonicalName Off

<VirtualHost *>

VirtualDocumentRoot  /data/www/%0(路径自己设定)

</VirtualHost>

 

6.       支持ssi

Apache默认是不支持SSI的,编辑httpd.conf文件,搜索“AddTypetext/html .shtml”,找到:

  # AddType text/html .shtml

  # AddOutputFilter INCLUDES .shtml

 

  把这两行前面的#去掉。

 

  然后搜索“Options Indexes FollowSymLinks”

 

  在搜索到的那一行后面添加“Includes”

 

  即将该行改变为Options Indexes FollowSymLinks Includes

7.       启停方式

进入apache目录下的bin目录

启动方式:./apachectl start

 

停止方式:./apachectl stop
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐