Linux下安装Apache httpd server

http://httpd.apache.org/docs/2.4/install.html

1. 安装依赖库 ARP, ARP-Util, PCRE

下载地址
http://apr.apache.org/download.cgi
http://www.pcre.org/

安装ARP
# tar zxf apr-1.5.2.tar.gz
# cd apr-1.5.2
# ./configure --prefix=/usr/local/apr
# make
# make install

安装ARP-Util
# tar zxf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure  --with-apr=/usr/local/apr
# make
# make install

安装PCRE
# tar zxf pcre-8.37.tar.gz
# cd pcre-8.37
# ./configure
# make
# make install

2. 下载及安装 Apache httpd

下载源码
http://httpd.apache.org/download.cgi#apache24

安装
# tar xzf httpd-2.4.18.tar.gz 
# cd httpd-2.4.18
# ./configure --enable-mods-shared=all #默认安装在/usr/local/apache2
# make
# make install

配置
# vim /usr/local/apache2/conf/httpd.conf
--------
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8088
--------

启动/停止
# /usr/local/apache2/bin/apachectl -k start
# /usr/local/apache2/bin/apachectl -k stop

在浏览器访问 {IP}:8088
It works!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在Linux中离线更新Apache HTTP Server的详细步骤: 1.准备工作 在更新之前,我们需要先下载新版Apache HTTP Server安装包,并将其上传到Linux服务器中。假设我们已将安装包上传到`/home/user/httpd-2.4.51.tar.gz`。 2.备份旧版Apache HTTP Server 在更新之前,我们需要备份旧版Apache HTTP Server的配置文件和数据文件,以防万一。可以使用以下命令备份: ``` sudo cp -rp /etc/httpd /etc/httpd-backup sudo cp -rp /var/www /var/www-backup ``` 3.卸载旧版Apache HTTP Server 使用以下命令卸载旧版Apache HTTP Server: ``` sudo yum remove httpd ``` 4.解压和编译新版Apache HTTP Server 解压上传的安装包并进入解压后的目录。然后运行以下命令以配置、编译和安装新版Apache HTTP Server: ``` cd /home/user tar -zxvf httpd-2.4.51.tar.gz cd httpd-2.4.51 ./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-rewrite make sudo make install ``` 上述命令中,“--prefix”指定Apache HTTP Server安装路径,“--enable-so”开启动态模块支持,“--enable-ssl”启用SSL支持,“--with-ssl”指定SSL库的路径,“--enable-rewrite”启用URL重写模块。 5.复制旧版Apache HTTP Server的配置文件 使用以下命令将旧版Apache HTTP Server的配置文件复制到新版Apache HTTP Server的配置目录中: ``` cd /etc/httpd-backup sudo cp httpd.conf /usr/local/apache2/conf/httpd.conf ``` 6.启动新版Apache HTTP Server 使用以下命令启动新版Apache HTTP Server: ``` sudo /usr/local/apache2/bin/apachectl start ``` 7.检查Apache HTTP Server的版本号 使用以下命令检查Apache HTTP Server的版本号: ``` sudo /usr/local/apache2/bin/httpd -v ``` 以上就是在Linux中离线更新Apache HTTP Server的详细步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值