安装编译工具、下载工具、依赖包
yum -y install wget gcc make
yum -y pcre pcre-devel
yum -y install gcc-c++
安装apr
wget http://mirrors.hust.edu.cn/apache//apr/apr-1.6.3.tar.gz
tar zxvf apr-1.6.3.tar.gz
cd apr-1.6.3/
./configure --prefix=/usr/local/apr
make
make install
安装apr-util
wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
tar zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
安装pcre
wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz
tar zxvf pcre-8.42.tar.gz
cd pcre-8.42/
./configure --prefix=/usr/local/pcre
make
make install
安装apache
wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
tar zxvf httpd-2.4.33.tar.gz
cd httpd-2.4.33/
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make
make install
/usr/local/apache2/bin/apachectl start
提示信息:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using laofuxi.com. Set the 'ServerName' directive globally to suppress this message
修改配置文件里的主机名为本机的主机名(和hostname命令得到的内容相同)
vim /usr/local/apache2/conf/httpd.conf
#ServerName www.example.com:80
ServerName laofuxi.com:80
保存退出
再次启动的时候,就不会再有提示。
最后编辑:2018-05-09作者:劳福喜
这个作者貌似有点懒,什么都没有留下。