Apache httpd设置和安装

Pro*_*mer 80 apache apr

这是我第一次尝试在我的盒子中本地安装Apache HTTP服务器作为普通用户(非root用户).

我已经下载了Apache 2.4.1版本的Apache HTTP服务器[http://httpd.apache.org/download.cgi].但是,当我尝试在我的框中本地构建和安装时,我收到以下错误:

httpd/httpd-2.4.1 1059> ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... no
configure: error: APR not found.  Please read the documentation.
Run Code Online (Sandbox Code Playgroud)

我不确定它正在寻找什么依赖 - 我的意思是下载包不包含它?我需要做什么来构建/部署Apache HTTP服务器?

提前致谢.

Ole*_*eev 127

当它告诉你Please read documentation这意味着你应该去阅读Apache文档(http://httpd.apache.org/docs/2.4/install.html),它告诉你

Apache APR下载APR和APR-Util的最新版本,将它们解压缩到./srclib/apr和./srclib/apr-util(确保域名没有版本号;例如,APR分发必须在./srclib/apr/下

然后做

./configure --with-included-apr
Run Code Online (Sandbox Code Playgroud)

  • 他们为什么不把它包括在内呢?这似乎是浪费时间 (19认同)
  • 注意`./ srclib`表示`httpd-xxx`目录下的`srclib`目录 (8认同)
  • 甜蜜的成功..需要在Makefile中更改行:#PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS)$(PROGRAM_DEPENDENCIES)$(PCRE_LIBS)$(EXTRA_LIBS)$(AP_LIBS)$(LIBS)----> PROGRAM_LDADD = buildmark. o $(HTTPD_LDFLAGS)$(PROGRAM_DEPENDENCIES)$ HOME/lib/usr/local/lib/libpcre.a $(EXTRA_LIBS)$(AP_LIBS)$(LIBS) (3认同)

小智 38

对于Ubuntu 11.10,这个选项似乎运行良好:

 # APR

wget http://mirrors.axint.net/apache//apr/apr-1.4.6.tar.gz

tar -xvzf apr-1.4.6.tar.gz

cd apr-1.4.6/

./configure

make

make install

cd ..

# APR Utils

wget http://mirrors.axint.net/apache//apr/apr-util-1.4.1.tar.gz

tar -xvzf apr-util-1.4.1.tar.gz

cd apr-util-1.4.1

./configure --with-apr=/usr/local/apr

make

make install

cd ..

# Apache

wget http://apache.petsads.us//httpd/httpd-2.4.1.tar.gz

tar -xvzf httpd-2.4.1.tar.gz

cd httpd-2.4.1

./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-ssl --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/

make

make install

cd ..
Run Code Online (Sandbox Code Playgroud)

您可以在下面找到更多相关信息

资料来源:VaporCreations.com


shr*_*gon 24

如果您有Debian/Ubuntu,您可以:

apt-get install libapr1-dev libaprutil1-dev
Run Code Online (Sandbox Code Playgroud)

然后 ./configure

完成


小智 20

以下是我如何在非root用户上安装apache-httpd的步骤:

  1. 下载并解压缩apache-httpd-2.4.2(但在./configuring之前,制作并安装它,请按照以下步骤操作:)
  2. 下载APR和APR-UTIL并将其解压缩到"./srclib/apr"和"./srclib/apr-util"文件夹中.这需要./configure --with-apr =./ apache/httpd-2.4.2/srclib/apr(和)--with-included-apr(options).
  3. 下载,解压缩./configure(with)--prefix = localURL,make和make install PCRE到"./pcre"文件夹.这需要./configure --with-pcre =/home/username/apache/pcre(选项).
  4. 通过委托以下命令配置apache-httpd(我想启用下面命令中编写的某些选项):./ configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem -cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable -cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr = /home/username/apache/httpd-2.4.2/srclib/apr --prefix =/home/username/apache/httpd-2.4.2/--with-included-apr --with-pcre =/home/username/apache/pcre注意:配置apache-httpd时,如果安装了OpenSSL,则仅使用选项"--enable-ssl",否则请勿启用它.
  5. 现在在命令行中输入'make'和'make install'命令.
  6. 打开并配置'httpd.conf'文件,例如:"vi /home/eddie_kumar/apache/httpd-2.4.2/conf/httpd.conf"

重要提示:不要忘记将默认端口从80更改为其他内容,例如8080,这对非root用户尤为重要.(如何?打开httpd.conf - >搜索"Listen 80" - >将其更改为"Listen 8080".

就是这样,现在打开浏览器输入"localhost:8080 ",它应该显示"It works!".