Question

Setting up multiple virtual hosts with domain names

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?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@hansen

I think you’re right that I have to do the redirection on Tomcat. Your code still gives a 404 and the link changes to http://insiteweb.xyz/insite-1.5.1.RELEASE. When I try the redirect without /insite-1.5.1.RELEASE it works, but it only goes to the regular Tomcat page.

For the redirect on Tomcat, do I have to set a redirect in the index.jsp of ROOT or is there another better way?

This comment has been deleted

@hansen Ok, I will use copying in the future.

And it’s a new droplet so I can reinstall it. You mean rebuild to Ubuntu 16.04 Base Image?