I’ve setup my virtual host http://prntscr.com/chb2jq . Thin from Sinatra is running. http://prntscr.com/chb2v5 . 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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi!
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>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
You’ll want to configure Apache to reverse proxy all requests to example.com 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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.