手动升级 Apache HTTP 代理 (Windows)

若要将 Apache HTTP Proxy 升级到最新版本,请按照以下步骤进行操作。

1.备份以下文件:

C:\Program Files\Apache HTTP Proxy 2.[x.xx]\conf\httpd.conf

C:\Program Files\Apache HTTP Proxy 2.[x.xx]\bin\password.file

C:\Program Files\Apache HTTP Proxy 2.[x.xx]\bin\group.file

2.打开管理命令提示符并执行以下命令即可停用 ApacheHttpProxy 服务:

sc stop ApacheHttpProxy

3.从 ESET 下载站点下载 Apache HTTP Proxy 安装程序文件,然后将其内容提取到 C:\Program Files\Apache HTTP Proxy 2.[x.xx]\。提取期间,将会覆盖现有文件。

4.导航到 C:\Program Files\Apache HTTP Proxy 2.[x.xx]\conf,右键单击 httpd.conf,然后从上下文菜单中依次选择打开方式 > 记事本

5.将以下代码添加到 httpd.conf 的末尾:

ServerRoot "C:\Program Files\Apache HTTP Proxy 2.[x.xx]"
DocumentRoot "C:\Program Files\Apache HTTP Proxy 2.[x.xx]\htdocs"
<Directory "C:\Program Files\Apache HTTP Proxy 2.[x.xx]\htdocs">
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted
</Directory>
CacheRoot "C:\Program Files\Apache HTTP Proxy 2.[x.xx]\cache"

6.如果您设置了用于访问 Apache HTTP 代理的用户名/密码(Apache HTTP 代理安装主题),请替换以下代码块:

<Proxy *>
 Deny from all
</Proxy>

使用以下内容(可以在步骤 1 中备份的 httpd.conf 备份文件中找到):

<Proxy *>
 AuthType Basic
 AuthName "Password Required"
 AuthUserFile password.file
 AuthGroupFile group.file
 Require group usergroup
 Order deny,allow
 Deny from all
 Allow from all
</Proxy>


important

如果对以前安装的 Apache HTTP 代理中的 httpd.conf 文件进行了其他自定义修改,可以将备份的 httpd.conf 文件中的这些配置修改复制到新的(升级后)httpd.conf 文件。

7.保存更改,然后在管理命令提示符下执行以下命令来启动 ApacheHttpProxy 服务:

sc start ApacheHttpProxy

8.更新服务说明中的版本。

sc description ApacheHttpProxy "Apache/2.4.43"

9.通过使用浏览器访问以下 URL,测试到 Apache HTTP 代理的连接:

http://[IP address]:3128/index.html

如果需要解决遇到的问题,请参阅 Apache HTTP 代理日志文件