Linux安装配置apache
2016-07-25 11:05
465 查看
1.获取软件: http://httpd.apache.org/ httpd-2.2.21.tar.gz
2.安装步骤:
解压源文件:
运行./configure 命令进行编译源代码,
--prefix=/usr/local/apach2 是设置编译安装到的系统目录,
--enable-s 参数是使httpd服务能够动态加载模块功能,
--enable-rewrite 是使httpd服务具有网页地址重写功能。
make 失败没有安装OpenSSl
3.启动apache:
/usr/local/apache2/bin/apachectl start
4.将apache加入到系统服务,用service命令来控制apache的启动和停止
首先以apachectl脚本为模板生成Apache服务控制脚本:
grep -v "#" /usr/local/apache2/bin/apachectl > /etc/init.d/apache
用vi编辑Apache服务控制脚本/etc/init.d/apache:
vi /etc/init.d/apache
在文件最前面插入下面的行,使其支持chkconfig命令:
#!/bin/sh
# chkconfig: 2345 85 15
# description: Apache is a World Wide Web server.
保存后退出vi编辑器,执行下面的命令增加Apache服务控制脚本执行权限:
chmod +x /etc/init.d/apache
执行下面的命令将Apache服务加入到系统服务:
chkconfig --add apache
执行下面的命令检查Apache服务是否已经生效:
chkconfig --list apache
命令输出类似下面的结果:
apache 0:off 1:off 2:on 3:on 4:on 5:on 6:off
表明apache服务已经生效,在2、3、4、5运行级别随系统启动而自动启动,以后可以使用service命令控制Apache的启动和停止。
启动Apache服务: service apache start
停止Apache服务: service apache stop
执行下面的命令关闭开机自启动: chkconfig apache off
2.安装步骤:
解压源文件:
1 tar zvxf httpd-2.2.21.tar.gz 2 cd httpd-2.2.21 3 ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite 4 make 5 make install
运行./configure 命令进行编译源代码,
--prefix=/usr/local/apach2 是设置编译安装到的系统目录,
--enable-s 参数是使httpd服务能够动态加载模块功能,
--enable-rewrite 是使httpd服务具有网页地址重写功能。
make 失败没有安装OpenSSl
3.启动apache:
/usr/local/apache2/bin/apachectl start
4.将apache加入到系统服务,用service命令来控制apache的启动和停止
首先以apachectl脚本为模板生成Apache服务控制脚本:
grep -v "#" /usr/local/apache2/bin/apachectl > /etc/init.d/apache
用vi编辑Apache服务控制脚本/etc/init.d/apache:
vi /etc/init.d/apache
在文件最前面插入下面的行,使其支持chkconfig命令:
#!/bin/sh
# chkconfig: 2345 85 15
# description: Apache is a World Wide Web server.
保存后退出vi编辑器,执行下面的命令增加Apache服务控制脚本执行权限:
chmod +x /etc/init.d/apache
执行下面的命令将Apache服务加入到系统服务:
chkconfig --add apache
执行下面的命令检查Apache服务是否已经生效:
chkconfig --list apache
命令输出类似下面的结果:
apache 0:off 1:off 2:on 3:on 4:on 5:on 6:off
表明apache服务已经生效,在2、3、4、5运行级别随系统启动而自动启动,以后可以使用service命令控制Apache的启动和停止。
启动Apache服务: service apache start
停止Apache服务: service apache stop
执行下面的命令关闭开机自启动: chkconfig apache off
相关文章推荐
- Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- Windows下配置Apache运行C语言的CGI脚本
- org.apache.catalina.deploy.WebXml addFilter
- Apache学习笔记之日志文件
- org.apache.kafka.common.network.Selector
- 数据驱动测试三:使用TestNG、Apache POI和Excel文件进行数据驱动
- Apache CarbonData :一种为更加快速数据分析而生的新Hadoop文件版式
- 大数据分析界的“神兽”Apache Kylin有多牛?
- apache 问题 You don't have permission to access /test.php on this server 解决方法
- 源码和手动安装apache及存放路径
- 08R2 + Apache + PHP
- 记一次phpStudy apache启动后自动关闭 修改过程
- 学习笔记:进步一认识mesos(部分翻译)
- ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception
- apache 虚拟主机
- apache resin 端口关联
- log4J
- jakarta.apache.org/Velocity语法
- org.apache.poi 读取 excel xls xlsx
- Linux下查看mysql、apache是否安装,安装,卸载等操作