Site is down after attempts to set a subdoamin
I got a problem while trying to set up a "blog" subdomain for my site. So - I used this tutorial for that -
After I made all steps and restarted Apache i found that neither my subdomain nor main site work.
Can You help me with how to find reason of that and fix the problem?
Thank You in advance!!!
PS - I got Ubuntu 10.04 there.
10 Replies
The apache error is in /var/log/apache/error.log by default
@
(2)No such file or directory: apache2: could not open error log file /srv/www/blog/logs/error.log.
Unable to open logs
@
I created now disrectory and file there, ofcourse this is not a reason.
Nothing else in fresh logs.
Also after command /etc/apache2/sites-available# ls -la
I get -
"total 28
drwxr-xr-x 2 root root 4096 2012-04-07 16:32 .
drwxr-xr-x 7 root root 4096 2011-12-11 17:49 ..
-rw-r–r-- 1 root root 267 2012-04-07 18:01 blog.domain.com
-rw-r--r-- 1 root root 948 2011-09-01 05:44 default
-rw-r--r-- 1 root root 7467 2011-09-01 05:44 default-ssl
-rw-r--r-- 1 root root 305 2011-11-06 14:15 domain.com"
I guess the problem could be in blog.domain.com if I set it not correctly. Can it help when I kill the subdomain and how to do that if yes?
configuration files - where can I find them?
As you can easily see, it says "no such directory" when looking for the custom log directory your virtualhost refers to, you must always make all directories referenced in a config file before reloading/restarting or else apache will not start back up.
go make the /srv/www/blog/logs/ directory and try reloading apache again
Also, error.log.1 isn't the latest log, the latest one will just be error.log
What about logs - I cannot find any more error logs for today.
Any more suggestions?
PS - First goal now is to have main site "domain.com" online, I do not care about sub-d. now.
What does Apache think? apache2ctl -S
What are the contents of all of the site configuration files?
total 0
lrwxrwxrwx 1 root root 26 2011-11-06 14:07 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 36 2012-04-07 16:50 blog.domain.com -> ../sites-available/blog.domain.com
lrwxrwxrwx 1 root root 31 2011-11-06 14:20 domain.com -> ../sites-available/domain.com
root@shopz:~# apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and default servers:
*:80 is a NameVirtualHost
default server shopz.domain.com (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost shopz.domain.com (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost blog.domain.com (/etc/apache2/sites-enabled/blog.domain.com:1)
port 80 namevhost domain.com (/etc/apache2/sites-enabled/domain.com:1)
Syntax OK
Please give me a hint where I can find site configuration files?
cat /etc/apache2/sites-enabled/*
So here is what we got -
DocumentRoot /var/www
AllowOverride None
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
Possible values include: debug, info, notice, warn, error, crit,
alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
ServerName blog.domain.com
ServerAlias
DocumentRoot /srv/blog/public_html/
ErrorLog /srv/blog/logs/error.log
CustomLog /srv/blog/logs/access.log combined
ServerName domain.com
ServerAlias
DocumentRoot /srv/www/domain.com/public_html/
ErrorLog /srv/www/domain.com/logs/error.log
CustomLog /srv/www/domain.com/logs/access.log combined
Please)