[GH-ISSUE #1915] 服务端设置vhost_http_port和vhost_https_port后服务无法启动 #1519

Closed
opened 2026-05-05 12:57:38 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @yilong877 on GitHub (Jul 25, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1915

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.33.0

What operating system and processor architecture are you using (go env)?
Centos7

Configures you used:

[common]
bind_addr = 0.0.0.0
bind_port = 10000
dashboard_addr = 0.0.0.0
dashboard_port = 10001
vhost_http_port = 80
vhost_https_port = 443
dashboard_user = admin
dashboard_pwd = admin
enable_prometheus = true
log_file = /etc/frp/frps.log
log_level = info
log_max_days = 3
detailed_errors_to_client = true
authentication_method = token
token = 123456
protocol = tcp
max_pool_count = 3
max_ports_per_client = 3
tcp_mux = true

Steps to reproduce the issue:

1.sudo cp -r frp_0.33.0_linux_amd64 /etc/frp
2.cd /etc/frp && sudo touch frps.log && sudo chmod a+w frps.log
3.sudo cp frps /usr/bin/ && sudo cp systemd/frps.service /usr/lib/systemd/system/
4.sudo systemctl enable frps.service && sudo systemctl start frps.service

Describe the results you received:
服务无法启动

Describe the results you expected:
服务正常启动

Additional information you deem important (e.g. issue happens only occasionally):
如果我将vhost_http_port = 80vhost_https_port = 443注释掉,服务就能跑起来了。

Can you point out what caused this issue (optional)
我在centos7 和 debian 9中都试过了,都是一样的问题,不知道是我操作有问题,还是别的原因导致的

Originally created by @yilong877 on GitHub (Jul 25, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1915 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** `0.33.0` **What operating system and processor architecture are you using (`go env`)?** `Centos7` **Configures you used:** ``` [common] bind_addr = 0.0.0.0 bind_port = 10000 dashboard_addr = 0.0.0.0 dashboard_port = 10001 vhost_http_port = 80 vhost_https_port = 443 dashboard_user = admin dashboard_pwd = admin enable_prometheus = true log_file = /etc/frp/frps.log log_level = info log_max_days = 3 detailed_errors_to_client = true authentication_method = token token = 123456 protocol = tcp max_pool_count = 3 max_ports_per_client = 3 tcp_mux = true ``` **Steps to reproduce the issue:** ``` 1.sudo cp -r frp_0.33.0_linux_amd64 /etc/frp 2.cd /etc/frp && sudo touch frps.log && sudo chmod a+w frps.log 3.sudo cp frps /usr/bin/ && sudo cp systemd/frps.service /usr/lib/systemd/system/ 4.sudo systemctl enable frps.service && sudo systemctl start frps.service ``` **Describe the results you received:** 服务无法启动 **Describe the results you expected:** 服务正常启动 **Additional information you deem important (e.g. issue happens only occasionally):** 如果我将`vhost_http_port = 80`和`vhost_https_port = 443`注释掉,服务就能跑起来了。 **Can you point out what caused this issue (optional)** 我在centos7 和 debian 9中都试过了,都是一样的问题,不知道是我操作有问题,还是别的原因导致的
Author
Owner

@fatedier commented on GitHub (Jul 26, 2020):

检查 frps 的日志看又什么报错信息。

<!-- gh-comment-id:663931315 --> @fatedier commented on GitHub (Jul 26, 2020): 检查 frps 的日志看又什么报错信息。
Author
Owner

@yilong877 commented on GitHub (Jul 26, 2020):

  • 未设置vhost_http_port和vhost_https_port

frps服务正常启动,frps.log显示如下:

020/07/26 14:14:19 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 14:14:19 [I] [service.go:277] Dashboard listen on 0.0.0.0:10001
2020/07/26 14:14:19 [I] [root.go:209] start frps success
  • 设置vhost_http_port和vhost_https_port后

frps服务无法启动,frps.log也未有报错信息,但是会一直监听10000端口:

2020/07/26 15:42:15 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:20 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:26 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:31 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:36 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:41 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:47 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:52 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:42:57 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:02 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:08 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:13 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:18 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:23 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:29 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:34 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:39 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 15:43:44 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
<!-- gh-comment-id:663954495 --> @yilong877 commented on GitHub (Jul 26, 2020): - ### 未设置vhost_http_port和vhost_https_port frps服务正常启动,frps.log显示如下: ``` 020/07/26 14:14:19 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 14:14:19 [I] [service.go:277] Dashboard listen on 0.0.0.0:10001 2020/07/26 14:14:19 [I] [root.go:209] start frps success ``` - ### 设置vhost_http_port和vhost_https_port后 frps服务无法启动,frps.log也未有报错信息,但是会一直监听10000端口: ``` 2020/07/26 15:42:15 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:20 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:26 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:31 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:36 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:41 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:47 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:52 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:42:57 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:02 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:08 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:13 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:18 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:23 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:29 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:34 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:39 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 15:43:44 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 ```
Author
Owner

@fatedier commented on GitHub (Jul 26, 2020):

不要使用 systemd,直接使用命令行启动,方便调试。

<!-- gh-comment-id:663959386 --> @fatedier commented on GitHub (Jul 26, 2020): 不要使用 systemd,直接使用命令行启动,方便调试。
Author
Owner

@yilong877 commented on GitHub (Jul 26, 2020):

  • 未使用systemd,设置vhost_http_portvhost_https_port

1.cd /etc/frp
2.sudo ./frps -c ./frps.ini

服务正常启动:

2020/07/26 16:46:42 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 16:46:42 [I] [service.go:220] http service listen on 0.0.0.0:80
2020/07/26 16:46:42 [I] [service.go:241] https service listen on 0.0.0.0:443
2020/07/26 16:46:42 [I] [service.go:277] Dashboard listen on 0.0.0.0:10001
2020/07/26 16:46:42 [I] [root.go:209] start frps success
  • 我自己的一些改动

我把systemd文件夹里的frps.service作了一下改动
User=nobody注释

1.sudo sed -i 's/User=nobody/#User=nobody/' /usr/lib/systemd/system/frps.service
2.sudo systemctl daemon-reload
3.sudo systemctl restart frps.service

再用systemd启动的话,服务也是能开启的

非常感谢您的回复,解决了困惑我几天的问题!

<!-- gh-comment-id:663961744 --> @yilong877 commented on GitHub (Jul 26, 2020): - ### 未使用systemd,设置`vhost_http_port`和`vhost_https_port`后 ``` 1.cd /etc/frp 2.sudo ./frps -c ./frps.ini ``` 服务正常启动: ``` 2020/07/26 16:46:42 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 2020/07/26 16:46:42 [I] [service.go:220] http service listen on 0.0.0.0:80 2020/07/26 16:46:42 [I] [service.go:241] https service listen on 0.0.0.0:443 2020/07/26 16:46:42 [I] [service.go:277] Dashboard listen on 0.0.0.0:10001 2020/07/26 16:46:42 [I] [root.go:209] start frps success ``` - ### 我自己的一些改动 我把`systemd`文件夹里的`frps.service`作了一下改动 将`User=nobody`注释 ``` 1.sudo sed -i 's/User=nobody/#User=nobody/' /usr/lib/systemd/system/frps.service 2.sudo systemctl daemon-reload 3.sudo systemctl restart frps.service ``` 再用systemd启动的话,服务也是能开启的 非常感谢您的回复,解决了困惑我几天的问题!
Author
Owner

@xhminc commented on GitHub (Feb 26, 2021):

  • 未使用systemd,设置vhost_http_portvhost_https_port

1.cd /etc/frp
2.sudo ./frps -c ./frps.ini

服务正常启动:

2020/07/26 16:46:42 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/07/26 16:46:42 [I] [service.go:220] http service listen on 0.0.0.0:80
2020/07/26 16:46:42 [I] [service.go:241] https service listen on 0.0.0.0:443
2020/07/26 16:46:42 [I] [service.go:277] Dashboard listen on 0.0.0.0:10001
2020/07/26 16:46:42 [I] [root.go:209] start frps success
  • 我自己的一些改动

我把systemd文件夹里的frps.service作了一下改动
User=nobody注释

1.sudo sed -i 's/User=nobody/#User=nobody/' /usr/lib/systemd/system/frps.service
2.sudo systemctl daemon-reload
3.sudo systemctl restart frps.service

再用systemd启动的话,服务也是能开启的

非常感谢您的回复,解决了困惑我几天的问题!

终于找到解决方法!!

<!-- gh-comment-id:786358304 --> @xhminc commented on GitHub (Feb 26, 2021): > * ### 未使用systemd,设置`vhost_http_port`和`vhost_https_port`后 > > ``` > 1.cd /etc/frp > 2.sudo ./frps -c ./frps.ini > ``` > > 服务正常启动: > > ``` > 2020/07/26 16:46:42 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000 > 2020/07/26 16:46:42 [I] [service.go:220] http service listen on 0.0.0.0:80 > 2020/07/26 16:46:42 [I] [service.go:241] https service listen on 0.0.0.0:443 > 2020/07/26 16:46:42 [I] [service.go:277] Dashboard listen on 0.0.0.0:10001 > 2020/07/26 16:46:42 [I] [root.go:209] start frps success > ``` > > * ### 我自己的一些改动 > > 我把`systemd`文件夹里的`frps.service`作了一下改动 > 将`User=nobody`注释 > > ``` > 1.sudo sed -i 's/User=nobody/#User=nobody/' /usr/lib/systemd/system/frps.service > 2.sudo systemctl daemon-reload > 3.sudo systemctl restart frps.service > ``` > > 再用systemd启动的话,服务也是能开启的 > > 非常感谢您的回复,解决了困惑我几天的问题! 终于找到解决方法!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1519
No description provided.