Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting web_path results in 404 after setup #120

Open
calebjones opened this issue May 1, 2024 · 5 comments
Open

Setting web_path results in 404 after setup #120

calebjones opened this issue May 1, 2024 · 5 comments

Comments

@calebjones
Copy link

calebjones commented May 1, 2024

Docker Compose:

version: '3'

services:
  ampache:
    image: ampache/ampache:nosql
    container_name: ampache
    restart: unless-stopped
    ports:
      - 8080:80
    volumes:
      - /host/path/to/music:/media
    extra_hosts:
      - "host.docker.internal:host-gateway"

Startup command:

docker compose up -d

Database connects properly to my host and I am able to have this work (build catalog, stream music, etc) without setting web_path in the setup web UI.

However, if I set the web_path in the web UI to (for example) /ampache, after the setup completes it only ever returns 404 for /ampache (also tried /ampache/index.php or /ampache/login.php).

Going to / redirects (302) to /ampache/login.php which 404s.

@lachlan-00
Copy link
Member

are you proxying the container to be /ampache through something like nginx/etc?

The container is set to the / path on the webroot you would probably need the local_web_path set as well depending on your setup.

There are some issues with docker/proxying that i'll have a search for and see if there's anything in the wiki. cause i'm sure we've had this issue with people before

@calebjones
Copy link
Author

I'm not proxying yet, just testing directly. But I'm planning to proxy via either caddy or apache.

I'll check local_web_path.

@calebjones
Copy link
Author

calebjones commented May 3, 2024

config/ampache.cfg.php has these web_path values:

web_path = "/ampache"
;local_web_path = "http://localhost/ampache"

Adding local_web_path = "http://localhost/ampache" (uncommented) to the config file doesn't fix things.

@calebjones
Copy link
Author

calebjones commented May 3, 2024

I found a way to fix the 404, but I'm not sure how to fold this into the container so you can easily deploy a new container.

I ended up appending the following to /etc/apache2/sites-enabled/001-ampache.conf:

Alias /ampache "/var/www/public"

The issue is that docker can't know what the alias will be until after the initial ampache setup in the web UI.

@calebjones
Copy link
Author

calebjones commented May 4, 2024

I'd recommend adding a docker environment variable that can be passed into the docker command or set in docker-compose.yml to ensure this Alias is set.

... unless I'm missing something and there's a better way to do this. But on my previous installation (that I'm migrating from) Alias is how I set this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants