Seafile 7 only listens to 127.0.0.1

Newly installed Seafile on Ubuntu 18.04

I can access seahub from localhost, but I cannot access it over LAN by entering the server’s IP address.

I did some investigating and it seems that something is not configured right, but I do not know where.

This is what I see:

`sudo lsof -i -P -n |grep 8000

python2.7 5823 7u IPv4 83452 0t0 TCP 127.0.0.1:8000 (LISTEN)
python2.7 5829 7u IPv4 83452 0t0 TCP 127.0.0.1:8000 (LISTEN)
python2.7 5830 7u IPv4 83452 0t0 TCP 127.0.0.1:8000 (LISTEN)
python2.7 5831 7u IPv4 83452 0t0 TCP 127.0.0.1:8000 (LISTEN)
python2.7 5832 7u IPv4 83452 0t0 TCP 127.0.0.1:8000 (LISTEN)
python2.7 5833 7u IPv4 83452 0t0 TCP 127.0.0.1:8000 (LISTEN)
`
Python 2.7 runtime binds only to localhost, not to 0.0.0.0 so there is no access to seahub from outside. How can I tell seahub to listen to 0.0.0.0:8000?

V.

Correct me if im wrong but seahub cant talk with TLS so you probabbly want a reverse proxy anyway.

This is on a LAN. Yes I can set up a reverse proxy, but I am hoping to make it work as is. However reverse proxy may solve this issue as nginx is already running and reachable via LAN.

This seems random Cisco. Why did you post it? I keep looking and not finding anything relevant, did I miss something?

I’m facing the same issue. If anyone knows a solution without a reverse proxy, I’d be happy to hear

OK I solved it by remembering something from very early Seafile versions. When you install it it does not create its own directory but installs its directories in whichever location you ran the installation script and that you have ownership of.

So, find conf directory (mine was in the user home directory) and in there find gunicorn.conf file and make sure this line reads like so:

# default localhost:8000
bind = "0.0.0.0:8000"

Restart seafile and seahub.

If you are going to move the seafile directories into their own location, make sure you edit the pids path in the gunicorn.conf to point to wherever you placed them.

V.

2 Likes

It’s quite clear that he showed you how to adapt the config file to bind to 0.0.0.0.

That’s not random. Starting from release 7, the seahub is binded to localhost, which is the securest approach. This is called hardening the baseline.

2 Likes

It might be good hardening policy but it needs mentioning clearly in the documentation. I’ve spent several hours trying to fix this problem. I’m not a Linux guru so assumed I’d done something wrong. I even built another Ubuntu VM to test it out - I was using Mint before.

1 Like

https://manual.seafile.com/deploy/using_mysql/#running-seafile-server

## Running Seafile Server

### Starting Seafile Server and Seahub Website

Under seafile-server-latest directory, run the following commands

```
./seafile.sh start # Start Seafile service
./seahub.sh start  # Start seahub website, port defaults to 127.0.0.1:8000
```

The first time you start Seahub, the script would prompt you to create an admin account for your Seafile Server.

**Note:**  The Seahub service listens on  `127.0.0.1:8000`  by default. So we recommend that you deploy a reverse proxy service so that other users can access the Seahub service.

information is hard to find … it should be improved

I’m not using MySQL so I never read that page. I’m using SQLite and it’s not mentioned there :slight_smile: