Site is down after attempts to set a subdoamin

Hello all!

I got a problem while trying to set up a "blog" subdomain for my site. So - I used this tutorial for that -

http://www.podciborski.co.uk/unix/how-t … in-linode/">http://www.podciborski.co.uk/unix/how-to-create-a-sub-domain-in-linode/

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

What does your apache error log say? (Or the output when you try to restart apache for that matter?)

The apache error is in /var/log/apache/error.log by default

What do your configuration files look like, and what is in your logs?

It's the newest (today updated) log file - "error.log.1" -

@

(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?

Good news is, I already spotted your problem.

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 :) (You might want to check that error log some more as it might have other directories referenced that we don't know of).

Also, error.log.1 isn't the latest log, the latest one will just be error.log

As I said already I have created directory, file and restarted apache, but nothing happened - site is still down.

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.

Which sites do you have enabled? ls -l /etc/apache2/sites-enabled/

What does Apache think? apache2ctl -S

What are the contents of all of the site configuration files?

root@shopz:~# ls -l /etc/apache2/sites-enabled/

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?

They would be the files in /etc/apache2/sites-available/ that the links in /etc/apache2/sites-enabled/ point to. Easiest way to go:

cat /etc/apache2/sites-enabled/*

Thank You for advice, Hoopycat!

So here is what we got -

ServerAdmin webmaster@localhost

DocumentRoot /var/www

Options FollowSymLinks

AllowOverride None

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny

allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

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/"

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

Allow from 127.0.0.0/255.0.0.0 ::1/128

ServerAdmin admin@domain.com

ServerName blog.domain.com

ServerAlias www.blog.domain.com

DocumentRoot /srv/blog/public_html/

ErrorLog /srv/blog/logs/error.log

CustomLog /srv/blog/logs/access.log combined

ServerAdmin shopz@domain.com

ServerName domain.com

ServerAlias www.domain.com

DocumentRoot /srv/www/domain.com/public_html/

ErrorLog /srv/www/domain.com/logs/error.log

CustomLog /srv/www/domain.com/logs/access.log combined

Can anyone help me to make the site to work again?

Please)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct