挂载光盘
mount /dev/cdrom /mnt
删除yum.repos.d
目录下的所有repo文件
rm -rf /etc/yum.repos.d/*
创建新的文件dvd.repo
vim /etc/yum.repos.d/dvd.repo
刷新repos缓存生成的缓存
yum makecache
tar zxf httpd-2.4.46.tar.gz
[root@localhost src]# tar -zxf apr-1.7.0.tar.gz [root@localhost src]# ./configure --prefix=/usr/local/apr bash: ./configure: 没有那个文件或目录 [root@localhost src]# cd apr-1.7.0 [root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
tar -zxf ...
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
错误:
make[1]: 进入目录“/usr/local/src/apr-util-1.6.1” /bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private -I/usr/local/apr/include/apr-1 -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录 #include <expat.h> ^ 编译中断。 make[1]: *** [xml/apr_xml.lo] 错误 1 make[1]: 离开目录“/usr/local/src/apr-util-1.6.1” make: *** [all-recursive] 错误 1
解决:
yum install -y expat-devel
错误:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
下载安装:
https://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html
错误:
checking for windows.h… no
configure: error: Invalid C++ compiler or C++ compiler flags
安装:yum install -y gcc gcc-c++
接着安装pcre
./configure
make
make install
安装httpd
[root@localhost ~]# cd /usr/local/src/httpd-2.4.46 [root@localhost httpd-2.4.46]# ./configure --prefix=/usr/local/httpd
妈呀注意配置相关httpd的时候要注意,它依赖于:pcre还有 apr-util
./configure --prefix=/usr/local/httpd --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
终于可以了!
后面就是make&&make install
测试:echo $?
查看Makefile文件
进行编译:
make&&make install
查看:
ls /usr/local/httpd