【学习笔记】系列二:Linux安装配置apache
2015-09-23 11:48
1131 查看
1.获取软件: http://httpd.apache.org/ httpd-2.2.21.tar.gz
2.安装步骤:
@Apahce需要安装APR,见:/article/11538288.html
@下边使用参数 --enable-rewrite,需要安装PCRE,见:/article/11538289.html
解压源文件:
运行./configure 命令进行编译源代码,
--prefix=/usr/local/apach2 是设置编译安装到的系统目录,
--enable-s 参数是使httpd服务能够动态加载模块功能,
--enable-rewrite 是使httpd服务具有网页地址重写功能。
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.安装步骤:
@Apahce需要安装APR,见:/article/11538288.html
@下边使用参数 --enable-rewrite,需要安装PCRE,见:/article/11538289.html
解压源文件:
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服务具有网页地址重写功能。
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
相关文章推荐
- Apache 无法正常启动问题
- 揭秘Apache顶级项目大数据分析引擎 Flink:与Spark的对比与分析
- Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart
- Apache SSI配置 动态include静态html文件
- 使用LoadRunner监控Apache的步骤 (转)
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_数据分发和副本
- APACHE服务实验
- CentOs中Apache开启rewrite模块详解
- apache kafka系列之log4j配置
- apache kafka系列之在zookeeper中存储结构
- CentOS Apache虚拟主机配置
- org.apache.subversion.javahl.ClientException: svn: E155021: This client is too old to work with the
- Apache经常使用配置
- apache搭建
- Apache2.4+php5.6+Mysql5.6+Mantisbt 配置
- apache virtualhost 针对ip开放访问
- apache日志分析
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_节点间通信(Gossip)
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构之架构概要
- org.apache.hive.com.esotericsoftware.kryo.kryoexception: encountered unregistered class id 错误解决办法