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

Linux下apache安装

2016-05-17 21:44 645 查看
apache安装Apahce官网:httpd://httpd.apache.org/
一.安装
1.yum安装yum install httpd -y

2. 开启80端口: vi /etc/sysconfig/iptables

3.重启防火墙:service iptables restart

4.系统默认启动:chkconfig httpd on

二.配置apache服务

1.连接时间:

vi /etc/httpd/conf/httpd.conf

Timeout 60 //接收或发送,当持续连接等待超过60秒则该连接就中断

2.网页主目录:yum安装默认的目录路径为:/var/www/html

三.源码包安装
1.# tar zxvf httpd-2.2.*.tar.gz
# cd httpd-*
# ./configure --prefix=/usr/local/apache2 (默认安装位置) (编译时,需要gcc软件)

# make

#make install

2.apache的配置修改
# vi /usr/local/apache2/conf/httpd.conf
将#ServerName www.example.com:80 中的“#”删掉,并将 www.example.com 改为本机的linux的ip地址

设置Apache服务的启动级别:chkconfig --levels 235 httpd on
如果出现it works字样,说明apache安装成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  安装 apache