I just recently started to set up Apache on my Linux computer. I decided to use Virtual hosts because I want to run 2 web sites on the same machine. I set up both config files according to a tutorial I found. I did the following for both sites, where "mysite" is replaced by the domain name.
<VirtualHost *:80> ServerAdmin email@example.com ServerName mysite.eu ServerAlias www.mysite.eu DocumentRoot /var/www/mysite.eu/html ErrorLog /var/www/mysite.eu/log/error.log CustomLog /var/www/mysite.eu/log/access.log common </VirtualHost>
My problem is, that when I run this and try to connect via the domain, I get the message "This site can't be reached". I enabled both config files, disabled the default config file and created the A record on my domain provider's page. What's weird, is that it works when I add
127.0.0.1 mysite.eu and
127.0.0.1 mysite2.eu in
/etc/hosts. Any help regarding this issue would be appreciated.
On the web site of my domain provider I have the option to specify a sub domain, the type of redirection, and the target. For the sub domain, I set up one redirection with "@" and one with "www". Both have the redirection type "A". They both point to my IP address "192.xxx.xxx.xx". I tried to do point both to my public IP address starting with 89 but this didn't work either, it still said "This site can't be reached."