-
环境:Vmware17.0.0 、centos7-1810
-
安装包:apr-1.6.5.tar.gz
apr-util-1.6.3.tar.bz2
httpd-2.4.58.tar.gz
-
安装过程
1.将源码包复制到 centos 里面进行解压
[root@localhost Desktop]# ls apr-1.6.5.tar.gz apr-util-1.6.3.tar.bz2 httpd-2.4.58.tar.gz [root@localhost Desktop]# tar xf apr-1.6.5.tar.gz [root@localhost Desktop]# tar xf apr-util-1.6.3.tar.bz2 [root@localhost Desktop]# tar xf httpd-2.4.58.tar.gz [root@localhost Desktop]# ls apr-1.6.5 apr-util-1.6.3 httpd-2.4.58 apr-1.6.5.tar.gz apr-util-1.6.3.tar.bz2 httpd-2.4.58.tar.gz
2. 将解压过的 apr 和 apr-util 复制到 httpd/srclib 中,可以改名为 apr 和 apr-util ;
[root@localhost Desktop]# cp -r apr-1.6.5/ httpd-2.4.58/srclib/apr [root@localhost Desktop]# cp -r apr-util-1.6.3/ httpd-2.4.58/srclib/apr-util [root@localhost Desktop]# ll httpd-2.4.58/srclib/ total 12 drwxr-xr-x. 27 root root 4096 Nov 6 23:07 apr drwxr-xr-x. 20 root root 4096 Nov 6 23:07 apr-util -rw-r--r--. 1 504 games 121 Feb 11 2005 Makefile.in
3. 安装 pcre-devel 和 expat-devel ;
[root@localhost Desktop]# yum -y install pcre-devel.x86_64 [root@localhost Desktop]# yum -y install expat-devel.x86_64
4. 安装httpd
[root@localhost httpd-2.4.58]# ./configure --prefix=/usr/local/httpd-2.4.58[root@localhost httpd-2.4.58]# make && make install #编译并安装
5. 开启80端口
[root@localhost ~]# cd /usr/local/http2.4.58/ [root@localhost httpd-2.4.58]# ls bin cgi-bin error icons lib man modules build conf htdocs include logs manual [root@localhost httpd-2.4.58]# cd bin/ [root@localhost bin]# ls ab apxs envvars-std htdigest logresolve apachectl checkgid fcgistarter htpasswd rotatelogs apr-1-config dbmmanage htcacheclean httpd apu-1-config envvars htdbm httxt2dbm [root@localhost bin]# ./apachectl AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message [root@localhost bin]# netstat -anptl | grep "80" tcp 0 0 0.0.0.0:38025 0.0.0.0:* LISTEN 18749/rpc.statd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 51722/httpd tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 8013/dnsmasq