HugoFara/lwt-docker-installer

Trouble Hosting on VPS: Encountering 403 Forbidden Error with Apache

Closed this issue · 6 comments

I'm working on hosting the app on a VPS, but I've run into a '403 Forbidden' error that persists. The specific error message is:

Forbidden

You don't have permission to access this resource. Apache/2.4.56 (Debian) Server at [myIP] Port 8010

My goal is to have this application accessible from any location for convenience, so I'm seeking insights or advice on what could be causing this error and potential solutions to make it globally accessible.

Thank you in advance.

Following the error message, I think your VPS does not allow an app to be accessed on port 8010. What VPS are you using?

Generally speaking, you may try any of the following:

  • Change this line
    WEB_PORT=8010
    . The idea is to change the Docker exposed port to a port that can be accessed (it depends on your specific VPS authorization).
  • Change VPS settings. It may be the firewall settings that disabled the port.

Hope that helps!

I have the same problem but on a local machine that I don't plan to expose to the internet, any help?

I have the same problem but on a local machine that I don't plan to expose to the internet, any help?

So you are trying to connect from another computer on same local network? They can be many causes for this kind of trouble, so I can't give you a precise fix.

I'm including some generic help, and I recommend testing the components of your server one by one to narrow down the precise issue.

  1. File permission : unlikely as Docker changes it normally, but you can try to make sure Apache has access to the files using chmod.
  2. Directory permission : same as above, some directories may not be editable with the VPS. You can also use chown to let Apache access the directory.
  3. Firewall : some rules may block the port 8010. You can switch to another port if it's more convenient.

Also, don't hesitate to restart Apache. While I hope that helps, the issue is very dependent on your own configuration so it's hard to tell what is happening...

Thank you for the detailed reply!

So you are trying to connect from another computer on same local network?

No I planned to use it on the same machine I am installing the docker version on.

I already tried changing the file and directory permissions to make it work but nothing changed and I don't use any firewall on this machine and I further checked the ports so this seems a little strange to me.

I think I found your issue.

In the next version, yet unreleased, of LWT, the container will be accessible at http://localhost/lwt (instead of http://localhost). The installer uses the master branch which implements this change.

Your LWT instance should be accessible at http://localhost/lwt. Going to http://localhost results in 403 error as neither index.html nor index.php. Below is the error log

[autoindex:error] [pid 19] [client 172.18.0.1:60528] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
"GET / HTTP/1.1" 403 493

Hope that solves your issue! It's time to change the documentation!

This solves the issue! Thank you for your help.