Apache安装、配置、启动及添加服务.docx_第1页
Apache安装、配置、启动及添加服务.docx_第2页
Apache安装、配置、启动及添加服务.docx_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Apache安装、配置、启动及添加服务1 安装下载:httpd-2.4.1.zipapr-1.4.5.tar.gzapr-util-1.3.12.tar.gzpcre-8.10.zip编译:unzip httpd-2.4.1.zipcd httpd-2.4.1./configure -prefix=/usr/local/apache -enable-so异常:添加可执行权限:chmod +x *.sh安装依赖软件包:yum -y install gcc;yum -y install gcc+ gcc-c+(1)解决apr not found问题tar -zxf apr-1.4.5.tar.gzcd apr-1.4.5./configure -prefix=/usr/local/aprmake & make install(2)解决APR-util not found问题tar -zxf apr-util-1.3.12.tar.gzcd apr-util-1.3.12./configure -prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config make & make install (3)解决pcre问题unzip pcre-8.10.zipcd pcre-8.10/configure -prefix=/usr/local/pcremake & make install 再次编译Apache时加上:-with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util-with-pcre=/usr/local/pcre即:./configure -prefix=/usr/local/apache -enable-so -with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util -with-pcre=/usr/local/pcre最后安装:make & make install(4)遇到usr/bin/ld: .libs/pcrecpp.o: relocation R_X86_64_32S against .bsscan not be used when making a shared object; recompile with -fPIC.libs/pcrecpp.o:could not read symbols: Bad valuecollect2: ld returned 1 exit statusmake1: * libpcrecpp.la 错误 1make1: Leaving directory /usr/app/pcre-8.00make: * all 错误 2解决办法:./configure -disable-shared -with-pic再次安装:make & make install2 启动cd /usr/local/apache/bin./apachectl start异常:(1)httpd: Could not reliably determine the servers fully qualified domain name进入安装目:cd /usr/local/apache/conf,编辑httpd.conf文件,搜索“#ServerName”,添加ServerName localhost:80,再重新启动即可:/usr/local/apache/bin/apachectl restart;(2)Address already in use: AH00072: make_sock: could not bind to address :80netstat -lnp | grep 80,发现已经有进程占用80端口,kill掉,再启动Apache;3 验证在IE中打开localhost IP。此刻显示的网页是对应Apache安装目录/usr/local/apache/htdocs下的index.html页面,此页面可以自定义编辑;4 为Apache添加service 以apachectl脚本为模板生成Apache服务控制脚本:grep -v # /usr/local/apache/bin/apachectl /etc/init.d/apache编辑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运行级别随系统启动而自动启动,以后可以使用s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论