Report this

What is the reason for this report?

Setting up multiple virtual hosts with domain names

Posted on March 19, 2017

I’m trying to get my virtual hosts to work on Apache. I followed the tutorials here on this website, but for some reason both my domain names keep going to the standard Apache page instead of their own folders. I disables the 000-default.conf and enabled my own.

Here are my two configuration files:

<VirtualHost *:80>
	ServerAdmin info@insiteweb.xyz
	ServerName insiteweb.xyz
	ServerAlias www.insiteweb.xyz
	DocumentRoot /var/www/insiteweb.xyz/public_html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
	ServerAdmin info@moviezzz.nl
	ServerName moviezzz.nl
	ServerAlias www.moviezzz.nl
	DocumentRoot /var/www/moviezzz.nl/public_html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Inside the folders /var/www/moviezzz.nl/public_html and /var/www/insiteweb.xyz/public_html are both an index.html file. Yet I stil get send to the standard " It works !

If you’re seeing this page via a web browser, it means you’ve setup Tomcat successfully. Congratulations!" page of apache.

Does anyone know what the problem might be?



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!

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.

@hansen @Woet ,

Thanks for the @ tip, I’m fairly new here.

You were right, Tomcat was still running so I stopped it. I’m getting another message now when I try to go to the website’s “ERR_CONNECTION_REFUSED”. It says the website is unavailable. The error.log shows the following:

https://gyazo.com/ba99adf2fa685f31ed585bb14bb5d9cb

Btw this is in the folder apache2, because the folder apache doesn’t exist for me.

@martijnjansen I’ll start a new thread, since we maxed out the other one.

I would recommend that you run Apache publicly (*:80) and then do a reverse proxy to Tomcat (which will be running on a local port - let’s say 127.0.0.1:8080). That way your visitors don’t have to use a special port to access Tomcat, but will actually access Apache, which would just relay/proxy the connection to Tomcat. You only need to have Tomcat for WAR, so you’ll only use it for that.

Where are your vhost files located? Did you restart apache? What does apache2ctl -S show?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.