I have a script that runs with python3 -m http.server 8080
locally without issues on http://localhost:8080
I wanted to make it live on my web server running Plesk/Ubuntu.
First, I installed python3 via SSH and tried to run the same and it returns:
View in browser: http://localhost:8080
however, nothing happens when trying http://example.com:8080
in browser (just times out).
Also tried to enable the Plesk module by installing apt install libapache2-mod-python
and checking the Python box in "Hosting Settings" for that domain.
Tried with python3 -m http.server --bind 127.0.0.1 8080
and python3 -m http.server --bind example.com 8080
to no avail.
Tried setting up <VirtualHost> but figured it won't help since that's apache...
Any ideas how to make the python server visible from outside on port 8080 with Plesk?
CodePudding user response:
Turns out all I needed to do is add port 8080 to Plesk firewall.
Tools & Settings > Firewall > Modify Plesk Firewall Rules > Add Custom Rule