Linux下安装http webServer

2025-11-09 13:24:12

1、下载wget

yum -y install wget

2、mkdir /tmp/httpd

cd /tmp/httpd/

wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.17.tar.gz

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz

wget http://mirror.bit.edu.cn/apache/apr/apr-1.5.2.tar.gz

wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.gz

Linux下安装http webServer

3、tar zxvf pcre-8.37.tar.gz

cd pcre-8.37/

Linux下安装http webServer

1、tar zxvf pcre-8.37.tar.gz

cd pcre-8.37/

2、./configure --prefix=/usr/local/pcre/

gcc库没有安装

yum -y install gcc gcc-c++ pcre-devel

./configure --prefix=/usr/local/pcre/

make && make install

make clean

Linux下安装http webServer

Linux下安装http webServer

3、tar zxvf  httpd-2.4.17.tar.gz

tar zxvf apr-1.5.2.tar.gz httpd-2.4.17/srclib/

tar zxvf apr-util-1.5.4.tar.gz httpd-2.4.17/srclib/

cd httpd-2.4.17/srclib/

mv apr-1.5.2 apr

mv apr-util-1.5.4 apr-util

4、./configure --prefix=/usr/local/apache  -with-pcre=/usr/local/pcre-8.37/bin/pcre-config -with-included-apr

make && make install

make clean

5、配置httpd.conf

usr/local/apache/conf/httpd.conf

ServerName值改为localhost:80

1、添加80端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

2、重启防火墙

firewall-cmd --reload

1、cd /usr/local/apache/bin/

./apachectl -k start

2、输入IP地址,测试。

Linux下安装http webServer

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢