Ubuntu下编译安装Apache

Ubuntu版本:12.10

Apache最新版本:2.4.4 下载地址:http://httpd.apache.org/download.cgi

APR和APR-Util下载地址: http://apr.apache.org/

APR最新版本:1.4.8

APR-Util最新版本:1.5.2

PCRE最新版本:8.3.3 下载地址:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/


1.安装PCRE

解压PCRE源码包到用户目录:~/pcre-8.33/

cd ~/pcre-8.33

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

make

sudo make install

2.安装Apache 见http://httpd.apache.org/docs/2.4/install.html

解压Apache源码包到用户目录:~/httpd-2.4.4

解压APR到:~/httpd-2.4.4/srclib/apr

解压APR-Util到:~/httpd-2.4.4/srclib/apr-util

cd ~/httpd-2.4.4

./configure

make

sudo make install

3.配置httpd.conf

sudo vim /usr/local/apache2/conf/httpd.conf

找到#ServerName那行,修改为:ServerName localhost:80

4.启动Apache

sudo /usr/local/apache2/bin/apachectl start

5.测试

打开浏览器,在地址栏输入:localhost,页面显示:It works! 这样就安装完成了

你可能感兴趣的:(Linux,Apache,Linux)