Ubuntu安装httpd

下载及安装httpd

下载地址:http://httpd.apache.org/download.cgi

解压:tar -jxvf httpd-2.4.51.tar.bz2

cd httpd-2.4.51/ 安装:.
/configure --prefix=/usr/local/apache2

若编译报错 error: APR not found,则需要安装下面的依赖库

下载相应的库:
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz  
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz  
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
安装APR,解决APR not found的问题
tar -zxf apr-1.4.5.tar.gz  
cd apr-1.4.5  
./configure --prefix=/usr/local/apr  
make && make install

安装apr util,解决APR-util not found问题

tar -zxf apr-util-1.3.12.tar.gz
cd apr-util-1.3.12
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install

安装pcre,解决pcre问题

unzip -o pcre-8.10.zip
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make && make install

进入httpd解压后的文件夹,安装httpd

./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-ssl --with-ssl=/usr/local/openssl
make && make install

安装后的文件夹位置是:/usr/local/httpd

posted @ 2021-11-27 10:37  暮雨浅忆  阅读(2165)  评论(0编辑  收藏  举报