欢迎来到天天文库
浏览记录
ID:50989639
大小:44.16 KB
页数:3页
时间:2020-03-08
《Apache安装、配置、启动及添加服务.docx》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、Apache安装、配置、启动及添加服务1安装下载:httpd-2.4.1.zipapr-1.4.5.tar.gzapr-util-1.3.12.tar.gzpcre-8.10.zip编译:unziphttpd-2.4.1.zipcdhttpd-2.4.1./configure--prefix=/usr/local/apache--enable-so异常:添加可执行权限:chmod+x*.sh安装依赖软件包:yum-yinstallgcc;yum-yinstallgcc+gcc-c++(1)解决aprnotfound问题tar-zxfa
2、pr-1.4.5.tar.gzcdapr-1.4.5./configure--prefix=/usr/local/aprmake&&makeinstall(2)解决APR-utilnotfound问题tar-zxfapr-util-1.3.12.tar.gzcdapr-util-1.3.12./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-configmake&&makeinstall(3)解决pcre问题unzippcre-8.10.
3、zipcdpcre-8.10/configure--prefix=/usr/local/pcremake&&makeinstall再次编译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/ap
4、r-util--with-pcre=/usr/local/pcre最后安装:make&&makeinstall(4)遇到usr/bin/ld:.libs/pcrecpp.o:relocationR_X86_64_32Sagainst`.bss'cannotbeusedwhenmakingasharedobject;recompilewith-fPIC.libs/pcrecpp.o:couldnotreadsymbols:Badvaluecollect2:ldreturned1exitstatusmake[1]:***[libpcrec
5、pp.la]错误1make[1]:Leavingdirectory`/usr/app/pcre-8.00'make:***[all]错误2解决办法:./configure--disable-shared--with-pic再次安装:make&&makeinstall2启动cd/usr/local/apache/bin./apachectlstart异常:(1)httpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname进入安装目:cd/usr/local/apac
6、he/conf,编辑httpd.conf文件,搜索“#ServerName”,添加ServerNamelocalhost:80,再重新启动即可:/usr/local/apache/bin/apachectlrestart;(2)Addressalreadyinuse:AH00072:make_sock:couldnotbindtoaddress0.0.0.0:80netstat-lnp
7、grep80,发现已经有进程占用80端口,kill掉,再启动Apache;3验证在IE中打开localhostIP。此刻显示的网页是对应Apache安
8、装目录/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:2345851
9、5#description:ApacheisaWorldWideWebserver.保存后退出vi编辑器,执行下面的命令增加Apache服务控制脚本执行权限:chmod+x/etc/init.d/apache执行下面的命
此文档下载收益归作者所有