LAMP+Tomcat+Discuz+WordPress【Apache的安装】

来源:互联网 发布:标签机编辑软件 编辑:程序博客网 时间:2024/06/13 16:12

Apache安装

Apache版本:

Server version: Apache/2.2.19 (Unix)
安装包名称:httpd-2.2.19.tar.gz


[root@localhostLAMP]#tar -zxvf  httpd-2.2.19.tar.gz

[root@localhost LAMP]#cd httpd-2.2.19

[root@localhostLAMP]#./configure   --prefix=/usr/local/apache  --enable-shared=max   --enable-module=rewrite   --enable-module=so

[root@localhost LAMP]#make

[root@localhost LAMP]#make install

 

修改配置文件

[root@localhost LAMP]#vim /usr/local/apache/conf/httpd.conf

ServerName127.0.0.1:80

<IfModuledir_module>

DirectoryIndexindex.html index.html.var index.htm index.php

</IfModule>

# If the AddEncodingdirectives above are commented-out, then you

# probably shoulddefine those extensions to indicate media types:

AddTypeapplication/x-compress .Z

AddType application/x-gzip.gz .tgz

AddTypeapplication/x-httpd-php .php

AddTypeapplication/x-httpd-php-source .phps

 

到此结束,启动参数

/usr/local/apache/bin/apachectl   start

/usr/local/apache/bin/apachectl  stop

/usr/local/apache/bin/apachectl  restart

 

后面参考【可能有错误】:

[root@localhost LAMP]# cp /usr/local/apache/bin/apachectl /etc/init.d/apachectl

[root@localhost LAMP]# ln -s /usr/local/apache/bin/apachectl /usr/bin/apachectl

 

进入/etc目录下的rc2.d rc3.d rc4.d rc5.d 目录建立开机自启动服务的软链接文件;

[root@localhost etc]# ln -s../init.d/apachectl S20apache

进入/etc目录下的rc0.d rc1.d rc6.d 目录建立关机自停止服务的软链接文件;

[root@localhost etc]# ln -s../init.d/apachectl K20apache



参考:http://heylinux.com/archives/238.html


【文档下载】http://ishare.iask.sina.com.cn/f/17120832.html