I set up virtual hosts on ubuntu 12.04. But not everything is going as it should. I have two files in sites-enabled. One file holds the code for one site, and it works, one for a dozen other sites, and they work also. Except now I try to add another one to the second file, and the site cannot be found. Strangely enough, the first site in that file is also the site that is visible when I go to the ip of my server 18.104.22.168, skyo.be. The code is always the same:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/skyo/public_html ServerName www.skyo.be Serveralias sky.be Serveralias www.skyo.be ErrorLog /var/www/skyo/logs/error.log Loglevel warn CustomLog /var/www/skyo/logs/access.log combined <Directory /var/www/skyo/public_html> AllowOverride All Order allow,deny allow from all </Directory>
This is the first site in that file, when I put another site above this code, this site is visible on skyo.be. So is the new site I wanted to add. So I can access the site, all the redirections work.
I know this is kind of a mess, I would like to have different files, so for each site one file in sites-available instead of one (strangely enough the second file works). I followed the tutorial on creating virtual hosts:https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts
Does anyone have an idea how to get this fixed?
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.
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.
Click below to sign up and get $100 of credit to try our products over 60 days!