question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DO Guide - ERR_CONNECTION_REFUSED - CentOS 7

See original GitHub issue

Hello,

So I installed code-server following this guide - https://www.digitalocean.com/community/tutorials/how-to-set-up-the-code-server-cloud-ide-platform-on-centos-7 Before proceeding onto the subdomain configuration, I wanted to ensure that it’s working and to my dismay I’m only getting an ERR_CONNECTION_REFUSED in the web browser.

  • Web Browser: Google Chrome
  • Local OS: Windows 7 Professional
  • Remote OS: CentOS Linux release 7.8.2003 (Core)
  • Remote Architecture: x86_64
  • code-server --version: v3.4.1

At first, I’d like to mention that I’ve a previously running VestaCP installation on that server, so Apache and Nginx were pre-installed and running. Now, I was trying to bind code-server to port 1313, which has been opened in the firewall.

[root@sohamb03 ~]# systemctl status code-server
● code-server.service - code-server
   Loaded: loaded (/usr/lib/systemd/system/code-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-07-10 03:03:27 EDT; 5ms ago
 Main PID: 19902 ((e-server))
   CGroup: /system.slice/code-server.service
           ‣ 19902 [(e-server)]

Jul 10 03:03:27 sohamb03.tk systemd[1]: Stopped code-server.
Jul 10 03:03:27 sohamb03.tk systemd[1]: Started code-server.

But again sudo lsof -i:1313 produces no output. 😦

Here’s the code-server.service file.

[Unit]
Description=code-server
After=nginx.service

[Service]
Type=simple
Environment=PASSWORD=testpass123
ExecStart=/usr/bin/code-server --bind-addr 0.0.0.0:1313 --user-data-dir /var/lib/code-server --auth password
Restart=always

[Install]
WantedBy=multi-user.target

I’ve checked issue #737 but doesn’t seem to help either.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Spacebodycommented, Oct 3, 2020

Umm, I never thought about that. I’ll give it a try and update you soon. 😃

Just change the line in service:

ExecStart=/usr/bin/code-server --bind-addr 0.0.0.0:1234 --user-data-dir /var/lib/code-server --auth password

to

ExecStart=/usr/bin/code-server/code-server --bind-addr 0.0.0.0:1234 --user-data-dir /var/lib/code-server --auth password

then it will work correctly.

That is because the binary file is in the directory /usr/bin/code-server/, the binary file itself is also called code-sever.

0reactions
nhooyrcommented, Jan 18, 2021

Going to close as there hasn’t been a response in a long time!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DO Guide - CentOS 7 · Issue #1875 · coder/code-server - GitHub
Hello, So I installed code-server following this guide ... DO Guide - ERR_CONNECTION_REFUSED - CentOS 7 #1875.
Read more >
Why can't I connect to my Apache/CentOS 7 server over HTTP?
First, the firewall. CentOS has firewalld enabled by default and drops connections for traffic over those ports. To enable http and https, you' ......
Read more >
How to Fix the ERR_CONNECTION_REFUSED Error in Chrome
To do this, disconnect the power supply to your router. You'll then need to wait for about 30 seconds, before plugging it back...
Read more >
Connection to Port 80 refused - CentOS forum
curl: (7) Failed to connect to 192.168.77.50 port 80: Connection refused [root@localhost ~]# if any of you now anything it will be of...
Read more >
Centos7 machine refusing connection to port - Server Fault
You can confirm by running netstat -l on the Centos server and checking for the local address with port 8245 and state LISTEN....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found