Display Pages after everything is setup.

Posted September 12, 2016 2.9k views

I’ve setup my virtual host . Thin from Sinatra is running. . What am I missing to display my Sinatra pages. I’m getting no errors so it should be something small I am missing. I can display the page but only the default is the virtual host page I made.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers


Based on the virtual host page that you’re getting, I’m assuming that you followed this tutorial to set up Apache. If so, your virtual host config should look like this:

<VirtualHost *:80>
    DocumentRoot /var/www/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

You’ll want to configure Apache to reverse proxy all requests to to your Sinatra app which is listening on localhost on port 8080. To do that, replace the DocumentRoot directive with the following:

    ProxyPreserveHost On
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

Finally, restart Apache so that the changes take effect:

sudo service apache2 restart

If that does not work, check the error log for any errors (the following command prints the last 40 lines of Apache’s error log):

sudo tail -40 /var/log/apache2/error.log
by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.

Thank you this answered my question