5月7日更新,时间校准后依然还会有500报错,下方的方法是无效的。目前可知最简单的解决方法就是重启一下客户端。
这是我自己架设VPN服务器后遇到的问题,不好说是否已经解决,只是暂时OK了,需要在日后使用中继续观察。以下是报错信息。
500 Internal Privoxy Error
Privoxy encountered an error while processing your request:Could not load template file no-server-data or one of its included components.
Please contact your proxy administrator.
If you are the proxy administrator, please put the required file(s)in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It’s typically the Privoxy install directory).
这个问题并不是我一个人遇到的,实际上网上我看到有不少人都遇到了。但解决方法几乎都不靠谱。因为基本上碰到这个问题的人都没有搞清楚到底为什么会产生这个错误。一直到最后我找到了这篇日志
https://www.obodizhu.com/online/v2ray-fix-500-internal-privoxy-error.html
感觉上说的挺靠谱的,问题出自V2RAY对服务器和客户端时间匹配要求较高,所以一旦出现使用端和服务器的本地时间发生较大差异时会报这个错误。依照这个理论解决方法其实不难,也就是同步客户端和服务器的时间同步网络时间即可。本地的时间同步我就不写了,很简单。我接下来遇到的问题是我的服务器装的ubuntu系统,那么咋个同步网络时间呢。首先,安装ntp,注意不同linux的安装方式不一样,ubuntu的方式是
apt-get install ntp
在安装的过程中仔细看一下就会发现,ubuntu本身自带这个,所谓安装不过是给ntp升了个级。OK,因为我是这方面小白,所以还是解释一个ntp是个啥,我直接引用了。
网络时间协议,英文名称:Network Time Protocol(NTP)是用来使计算机时间同步化的一种协议
升级后ntp后开始同步时间,同步对象是ntp时间服务器
ntpdate pool.ntp.org
可惜报错
the NTP socket is in use, exiting
网上查了一下,大部分都说是因为ntp的默认socket号是123,而ntp本身正在占用这个socket号,所以无法同步。解决方法就是暂时停用ntp服务
service ntpd stop
但神奇的是我这里又报错了
Failed to stop ntpd.service: Unit ntpd.service not loaded.
其实到最后我才发现,我这里要停止的服务应该是ntp,可为什么网上都写着ntpd呢?那当我输入停止ntpd的命令时肯定是报错啊。不过当时我并没有太在意这点,而是找了其他方法来关闭ntp,就是kill PID。利用下面这个命令查看默认端口123的占用者是谁。
lsof -i:123
会得到这个结果
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ntpd 20150 ntp 16u IPv4 48022499 0t0 UDP localhost.localdomain:ntp
ntpd 20150 ntp 17u IPv4 48022501 0t0 UDP 172.19.0.10:ntp
ntpd 20150 ntp 18u IPv6 48022503 0t0 UDP ip6-localhost:ntp
ntpd 20150 ntp 19u IPv6 48022507 0t0 UDP [fe80::5054:ff:fea5:7d38]:ntp
诶?名称是叫ntpd啊?!不管了,这个名称不对。kill对应的PID即可。然后重新nptdate校准时间。
kill -9 20150
最后为了验证这货到底叫啥,我试验了一下
service ntp stop
成功!所以不管别的系统里什么情况,至少在ubuntu里,ntp就叫ntp。
