Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Apr 08, 2012 7:32 am 
Offline
Senior Newbie

Joined: Sat Dec 24, 2011 10:49 am
Posts: 16
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/

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.


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 7:52 am 
Offline
Senior Newbie

Joined: Sat Mar 29, 2008 10:52 pm
Posts: 18
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


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 7:52 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
What do your configuration files look like, and what is in your logs?

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 8:22 am 
Offline
Senior Newbie

Joined: Sat Dec 24, 2011 10:49 am
Posts: 16
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?


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 8:33 am 
Offline
Senior Newbie

Joined: Sat Mar 29, 2008 10:52 pm
Posts: 18
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


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 8:55 am 
Offline
Senior Newbie

Joined: Sat Dec 24, 2011 10:49 am
Posts: 16
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.


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 10:01 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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?

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 10:25 am 
Offline
Senior Newbie

Joined: Sat Dec 24, 2011 10:49 am
Posts: 16
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?


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 12:07 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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/*

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Sun Apr 08, 2012 12:19 pm 
Offline
Senior Newbie

Joined: Sat Dec 24, 2011 10:49 am
Posts: 16
Thank You for advice, Hoopycat!

So here is what we got -

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

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

</VirtualHost>
<VirtualHost *:80>
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
</VirtualHost>
<VirtualHost *:80>
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
</VirtualHost>


Top
   
 Post subject:
PostPosted: Mon Apr 09, 2012 8:59 am 
Offline
Senior Newbie

Joined: Sat Dec 24, 2011 10:49 am
Posts: 16
Can anyone help me to make the site to work again?
Please)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group