欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ubuntu18,svn copy 建立分支时报 “Unexpected HTTP status 502 Bad Gateway on ”的解决

程序员文章站 2022-03-04 16:00:15
...
在ubuntu 18 上安装了apache2+svn+svnadmin +nginx 采用nginx https转http的方式访问svn
在客户端建立分支时,提示错误:Unexpected HTTP status 502 'Bad Gateway' on ....
查找网络上的方法,采用如下步骤解决:
1、在apache2的配置目录下找到000-default.conf,(也就是<VirtualHost > 所在的文件)
   增加一行:RequestHeader edit Destination ^https http early
 
​
<VirtualHost *:82>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin [email protected]
	DocumentRoot /var/www/html
   

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
 
	
 	RequestHeader edit Destination ^https http early

 
</VirtualHost>

​
保存后重新启动apache2 :# service apache2 restart
结果启动apache2 失败,查看日志报:Invalid command 'RequestHeader', perhaps misspelled or defined by a module
于是在网上一番查找,最终执行第二步问题解决。

2、执行下面命令来开启header:

# sudo a2enmod headers
# service apache2 restart

重新启动apache2 成功后,svn新建分支成功!