ssl - 挂接服务无法启动 |搭便车 1.5.2-1 | Ubuntu 20.04.1 LTS

标签 ssl tls1.2 varnish varnish-vcl varnish-4

我已经使用 sudo apt-get install hitch 在 Ubuntu 20.01.1 中安装了 Hitch “TLS 代理”。当我尝试启动服务时,我得到以下信息 >

     Loaded: loaded (/etc/systemd/system/hitch.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2020-10-09 12:51:47 EEST; 28s ago
    Process: 176323 ExecStartPre=/usr/sbin/hitch -t $HITCH_OPTIONS (code=exited, status=0/SUCCESS)
    Process: 176337 ExecStart=/usr/sbin/hitch --daemon $HITCH_OPTIONS (code=exited, status=1/FAILURE)

Oct 09 12:51:47 webserver-1 systemd[1]: Starting hitch...
Oct 09 12:51:47 webserver-1 hitch[176323]: Trying to initialize SSL contexts with your certificates
Oct 09 12:51:47 webserver-1 hitch[176323]: hitch configuration looks ok.
Oct 09 12:51:47 webserver-1 systemd[1]: hitch.service: Control process exited, code=exited, status=1/FAILURE
Oct 09 12:51:47 webserver-1 systemd[1]: hitch.service: Failed with result 'exit-code'.
Oct 09 12:51:47 webserver-1 systemd[1]: Failed to start hitch. 
我的/etc/hitch/hitch.conf 如下 >
tls-protos = TLSv1.2 TLSv1.3

frontend = {
    host = "*"
    port = "443"
}

#When using TCP/IP
backend = "[127.0.0.1]:6086"
workers = 2

# run Varnish as backend over PROXY; varnishd -a :80 -a localhost:6086,PROXY ..
write-proxy-v2 = on

#Using Unix Domain Sockets
#backend = "/run/varnish.sock"
#workers = 2
# We strongly recommend you create a separate non-privileged hitch
# user and group

daemon = on
user = "_hitch"
group = "_hitch"

#ocsp-dir = "/etc/hitch/ocsp"
#ocsp-verify-staple = on

#To generate a certificate use:
# cat cert.key cert.crt cacert.crt > /etc/hitch/certs/site1.com-combined.pe
pem-file = "/etc/letsencrypt/live/sunananas.com/hitch-bundle.pem"

# Enable to let clients negotiate HTTP/2 with ALPN. (default off) (jessie openssl doesn't suppor>
alpn-protos = "h2, http/1.1" 
此外,hitch.service 正在使用中 >
[Unit]
Description=hitch
After=syslog.target network.target

[Service]
Type=forking
#PIDFile=/run/hitch/hitch.pid
#Restart=on-failure
LimitNOFILE=131072
Environment="HITCH_OPTIONS=--config /etc/hitch/hitch.conf"
EnvironmentFile=-/etc/hitch/hitch.params
EnvironmentFile=-/etc/default/hitch
EnvironmentFile=-/etc/sysconfig/hitch
ExecStartPre=/usr/sbin/hitch -t $HITCH_OPTIONS
ExecStart=/usr/sbin/hitch --daemon $HITCH_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
我看到/run/hitch/目录丢失了,所以我 mkdir/run/hitch/没有成功。我还尝试使用 solution 覆盖挂接服务下面有同样的结果。
systemctl edit hitch.service

[Service]
ExecStartPre=-mkdir /run/hitch/
ExecStartPre=-chown hitch:hitch /run/hitch/
任何帮助表示赞赏

最佳答案

请尝试运行 /usr/sbin/hitch --config /etc/hitch/hitch.conf在命令行上手动查看它返回的错误。
注意: daemon选项在 hitch.conf 中有效这将使调试更加困难。请将此注释掉,以确保 Hitch 在前台运行。
让我知道该命令的输出是什么,以便我们找出解决方案。

关于ssl - 挂接服务无法启动 |搭便车 1.5.2-1 | Ubuntu 20.04.1 LTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64277891/

相关文章:

varnish - 是否有可能让 Varnish 重建整个站点?

java - 将外部服务器的自签名证书添加到我的 Tomcat 的受信任证书中

java - 无法在最新的谷歌浏览器上访问 https api

ssl - 在适用于 Android 4.0.X、4.1.X 和 4.2.X 的 Codename one App 上启用 TLS 1.2

java - SSLSocketFactory 忽略服务器证书

varnish - 如何在 Varnish 中的 default.vcl 中创建自定义函数?

varnish - 使 Varnish 成为代理而不重定向

macos - 具有真实证书的 Ocj-C 安全套接字服务器 - SSL 协议(protocol)错误(基于 GCDAsyncSockets)

java - 服务层远程握手异常

java - 在react-native run-android期间安装Gradle时出现SSL错误