2017-04-20 20:29:14

Hi.
I'm having an odd issue with virtual hosts on my Apache server. They simply don't work, without any errors at all. I have looked in any guides I can find and read any forums I can find on this topic, but I don't find anything useful, or anything I'm doing wrong.
The virtual host configuration file is exactly as shown in the guides I've found. I have tried to change the folder in the default configuration file, just to check that it loads the website in this folder. This works. But when I create a new virtual host file, enter the path to the folder which contains the working website, enable the virtual host and finally restart the Apache2 service, I get the "website not found" message.
So, there is access to the folder and files where the website is. Any clue on how to figure out what's wrong?
The only thing I hate in Linux is when it just don't work, and no errors are given...

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2017-04-20 20:35:53

it might not display any errors to stdout, but have you checked the logs?

2017-04-20 20:39:09

Thanks for the very quick answer. I'm not sure on what log files to check, and where they are located.

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2017-04-20 20:43:48

Oh. I found the error log. It says the following:
[Thu Apr 20 18:07:28.158389 2017] [core:notice] [pid 7256:tid 139622655655424] A
AH00094: Command line: '/usr/sbin/apache2'

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2017-04-21 16:12:09

on Debian based systems, its in /var/log/apache2

2017-04-22 09:51:19

When i try to access the folder /var/log/apache2, I get a permission denied. Sudo cd /var/log/apache2 don't work for some reason.

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2017-04-22 15:39:40

try executing:
ls -l /var/log | grep apache2
It should show what has access to this directory. Most often times its root and adm.

2017-04-24 13:26:20 (edited by Jonnyboy1991 2017-04-24 13:33:55)

Can you post what you have in your configuration file? that might help us to see what is going on. Your DocumentRoot directive is the one which should have your directory path to serve all of your files from. Also, the reason why your default virtual host is working is it might have your defaults say  as ServerName and Server Alias. without anything in them. So, check your host file and see if your ServerName and ServerAlias is in there. if you want the www.yourdomainname.com to to work, then that's what you would do with your ServerAlias and put that in there.
I hope this helps. I've been working with Linux systems for a while now so yeah.
edit: Note: the ServerName should have your domain as "domainname.com" or whatever you have your domain set to.

Jonathan Candler, A.K.A, Jonnyboy