`
ihyperwin
  • 浏览: 425355 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

ubuntu下apache httd/cgi的编译与安装

 
阅读更多

参考:http://www.jb51.net/article/18230.htm

http://www.51testing.com/html/18/311318-832068.html

 

首先到apache的主页下载最新版本的apache http server,地址为 http://httpd.apache.org/ 

安装apache: 
切换到httpd-2.4.6.tar.bz2所在目录,然后: 
 tar xvf httpd-2.4.6.tar.bz2 
此时在该目录下有一个文件夹httpd-2.4.6,切换到该文件夹: 
# cd ./httpd-2.4.6
安装到 /usr/local/apache2/ 下面,输入下面的命令: 
# ./configure --prefix= /usr/local/apache2 
# make 
# make install 

 

进行到./configure的时候报错。提示configure: error: APR not found. Please read the documentation.

解决方法:

1.解决apr not found问题
APR和APR-UTIL的下载地址:http://apr.apache.org/download.cgi

[root@yahoo test]#  tar vfc apr-1.4.8.tar.bz2 

[root@yahoo apr-1.4.8]# ./configure --prefix=/usr/local/apr

[root@yahoo apr-1.4.8]# make

[root@yahoo apr-1.4.8]# make install

2.解决APR-util not found问题

[root@yahoo test]#  tar -xvf apr-util-1.5.2.tar.bz2 

[root@yahoo apr-util-1.5.2]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

[root@yahoo apr-util-1.5.2]# make
[root@yahoo apr-util-1.5.2]# make install

3 ../configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util后出现

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/ 

#./configure –help | grep pcre

--with-pcre=PATH Use external PCRE library

下载:http://sourceforge.net/projects/pcre
下载地址二:http://ftp.exim.llorien.org/pcre/

#unzip -o pcre-8.33.zip 

#cd pcre-8.33

#./configure --prefix=/usr/local/pcre

#make

#make install

如报错:configure: error: You need a C++ compiler for C++ support.   

则安装c++编译器即可: sudo apt-get install g++

 

 

4.编译Apache

[root@yahoo httpd-2.4.6]# ./configure --prefix=/usr/local/apache2  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util /  --with-pcre=/usr/local/pcre

[root@yahoo  httpd-2.4.6]## make
[root@yahoo  httpd-2.4.6]#]# make install

 

make的时候报错如下:

 cannot find the library `/usr/local/apache2/lib/libapr-1.la' or unhandled argument `/usr/local/apache2/lib/libapr-1.la'

解决方法:

 mkdir /usr/local/apache2/lib/

sudo cp /usr/local/libapr-*    /usr/local/apache2/lib/

基本思路就是先建好/usr/local/apache2/lib/,然后将lib复制过去先。

 

执行完这3条命令之后,apache就安装到你的 /usr/local/apache2目录下了. 
# cd /usr/local/apache2 
# ls 
可以看到里面有 /bin ,/conf , /htdocs, /cgi-bin 等目录.此时apache还没有启动,我们通过/bin目录下的工具apachectl来启动,首先切换到/bin目录: 
# cd ./bin 
然后启动: 
# ./apachectl start 
这时候在地址栏输入 http://localhost/ 看看是不是有成功的信息?

 

如ok,则安装完毕。我本机报错如下:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

AH00015: Unable to open logs

 

需要修改/usr/local/apache2/conf/httpd.conf  

将ServerName localhost:8080 注释去掉并修改端口 。

将文件中Listen 80将它改为Listen 8080

 

之后重新启动,输入http://localhost:8080/。 然后就没有然后了,已经ok了。页面出现

It works! 

 

 

 

 

 

 

分享到:
评论

相关推荐

    apache2.4 windows编译工程 vs2005

    花了很长时间弄好的可以编译apache2.4的工程,一些基础环境需要自己安装

    winxp+svn+apache安装配置全说明

    Windows XP SP3 专业版 Setup-Subversion-1.6.4.msi 服务器端 TortoiseSVN-1.6.3.16613-win32-...编辑Apache的配置文件(我的为C:\Program Files\Apache Software Foundation\Apache2.2conf\httd.conf),修改以下内容:

    13.1 (17A5837a).zip

    Xcode 支持 iOS 13.1 (17A5837a) 放入路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

    apache虚拟主机三种配置方式小结

    使用虚拟主机必须要注释掉httpd的主机模块,即修改httd.conf的主配置文件,找到,将这段内容注释掉就可以了。 apche的虚拟主机配置一共有三种,即基于IP、基于port、...apache默然安装的时候,主配置文件位于/etc/httpd

    www:海洋动能与环境合规性,网站

    servr :: httd() 引导程序4 目前正在跳过Bootstrap 4,但保留_site.yml的注释选项。 remotes :: install_github( " rstudio/rmarkdown " ) remotes :: install_github( " rstudio/htmltools " ) remotes :: ...

    fk-esr-info:使用生态系统状态报告网站更新佛罗里达群岛信息图

    servr :: httd() 渲染图 source( " _make_infographic_modals.R " ) 材料 网站 信息图表包含JavaScript(JS)和样式(CSS),用于将图稿(* .svg)链接到单独的网页,并绘制数据 数据 文件夹,每个指标包含逗号...

Global site tag (gtag.js) - Google Analytics