I can not open my site. “Apache2 Ubuntu Default Page ”

September 3, 2018 1.5k views
Apache Python Ubuntu

I use a rental server and run it using PostgreSQL, Python, virtaulenv. We set up our own domain acquired by Namecheap on rental server. The IP address displayed on the rental server (supposing it is 123.45.6.789, TTL is 123) We have registered it in Namecheap. I can access by IP address, but when accessing in the domain, 'Apache 2 Ubuntu Default Page' was displayed. I do not use Apche 2, but Although the port is 5000, should I add it and register it with Namecheap? How do I get the site to show up?
I can not open it in the domain and 123.45.6.789, but I can open it if 123.45.6.789:5000.

1 Answer

Hey friend,

It sounds like you have Apache running on port 80 and your application on port 5000. You will need a web server on port 80 to handle this, as you cannot use DNS to mask a port number. What you will need to do is create a reverse proxy, which essentially means this:

When the user requests mydomain.com:80 (80 is default used when requesting "mydomain.com" without port), Apache loads the contents of "mydomain.com:5000" and returns them to the user requesting it over port 80.

There are several reverse proxy guides available here:
https://www.digitalocean.com/community/tutorials?q=reverse+proxy

Jarland

  • I added the following to /etc/apache2/sites-enabled/000-default.conf and /etc/apache2/sites-enabled/000-default-le-ssl.conf.
    ```ProxyPass / http: // domain: 5000
    ProxyPassReverse / http: // domain: 5000
    ProxyPassReverseCookieDomain IP: 5000 domain

    This caused the site to be displayed. It also encrypted with Encrypt. However, a new problem has occurred.
    [https://github.com/blobmon/simplechan
    ](http://)
    I installed the following site, but when trying to create a thread (moving Python, Postgresql, virtualenv), I get an error 'Error: mongodb exception: no variable id in line 24'. I installed a domain and it was working without problems before encrypting, but I can not do it for some reason. What should I do?
    
Have another answer? Share your knowledge.