1.下载apache
tar -xvzf httpd.xx 解压
2.下载安装pcre
Download PCRE from PCRE.org
解压,进入文件夹中
./configure --prefix=/usr/local/pcre
有可能会提示configure: error: You need a C++ compiler for C++ support.那么就安装c++组件age-get install g++
make
make install
3.下载apr, apr-util
进入apache文件夹中的srclib中
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
--prefix=/usr/local/pcre
make
make install
# 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
4.进入apache文件夹中
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/--with-pcre=/usr/local/pcre
makemake install 5.进入/usr/local/apache2/conf/httpd.conf搜索ServerName添加 ServerName localhost:80 完成
时间: 2024-11-05 04:54:31