Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Dec 16, 2010 11:44 am 
Offline
Senior Newbie

Joined: Thu Dec 16, 2010 11:38 am
Posts: 5
Hi, I'm in the progress of migrating a bunch of sites over to a new linode setup, and I've come across something weird that I've not previously seen.

I have a few virtual hosts set up, and most are working fine. One, however, is a very old site which is deliberately there for legacy reasons.

When I reload apache with this site enabled, I get an error message from apache about the *content* of the html files.

It's clearly parsing them, and seems to be complaining (I assume that it thinks that they aren't well formed in some way).

I don't really want to change the html - it's old and crap but that's ok, it is a historical archive in effect.

What I want to do is just disable this checking for the site only, but I can't figure out what is doing it and how to turn it off.

Anyone got any ideas?

My setup is ubuntu 10.4/apache2/php5. Some of my other sites are Drupal based, but the one with the problem is pure html.


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 11:59 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Link? Error message?


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 12:06 pm 
Offline
Senior Newbie

Joined: Thu Dec 16, 2010 11:38 am
Posts: 5
akerl wrote:
Link? Error message?


Sorry - I can give you the error message, but it's pointless - it's a specific error about some specific html in a specific file.

What I want to know is whether someone has come across this behaviour before (apache parsing the actual content of html files), and knows how to turn it off.

fwiw, here's an example of the error:


apache2: Syntax error on line 236 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/sites-enabled/05-old.elegantchaos.com/documents/lastexit/externals/Alias.html: /etc/apache2/sites-enabled/05-old.elegantchaos.com/documents/lastexit/externals/Alias.html:1: <HEAD> was not closed.
...fail!


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 1:29 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
samdeane wrote:
apache2: Syntax error on line 236 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/sites-enabled/05-old.elegantchaos.com/documents/lastexit/externals/Alias.html: /etc/apache2/sites-enabled/05-old.elegantchaos.com/documents/lastexit/externals/Alias.html:1: <HEAD> was not closed.
...fail!


It would appear that you've placed the document root of the transferred sites inside the /etc/apache2/sites-available folder (the "sites-enabled" folder only contains symlinks to those sites in "site-available" that have been activated). Considering that apache2.conf attempts to load /etc/apache2/sites-enabled/*, that would also mean any subfolders will be considered part of your Apache configuration.

Move the documents folders of each of your sites to somewhere else, and you would come a long way; ie. rather making them subfolders of locations like /home/www-data, /var/www, /srv or my own favorite flavor, /space/web (as long as the right directories are created and have the right permissions set, you can really place them almost anywhere you like).


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 1:33 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
Are you sure you have the HTML files in the right location? /etc/apache/apache2/sites-available is a configuration directory for Apache and shouldn't be where you keep content.

So it sounds like Apache is trying to parse your HTML as a configuration file. Apache configuration files are XML, so you're probably getting an error from the XML parsing.

Files in sites-enabled are usually just links to files in sites-available, and are included from the main apache2.conf file.

-- David


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 1:56 pm 
Offline
Senior Newbie

Joined: Thu Dec 16, 2010 11:38 am
Posts: 5
db3l wrote:
Are you sure you have the HTML files in the right location? /etc/apache/apache2/sites-available is a configuration directory for Apache and shouldn't be where you keep content.

So it sounds like Apache is trying to parse your HTML as a configuration file. Apache configuration files are XML, so you're probably getting an error from the XML parsing.

Files in sites-enabled are usually just links to files in sites-available, and are included from the main apache2.conf file.

-- David


The way I have it set up, sites-available contains symbolic links for a number of other config files, one for each of my virtual hosts. Sites-enabled contains symbolic links which point to these.

I want it set up this way if possible, so that the config file for the site is located with the other files - each site is checked into its own git repository, so I really don't want the configs to have to live in a central location.

Good call about Apache trying to parse the html files as if they were config files though - that sounds a lot more plausible than it mysteriously deciding to validate my html!

I'll take another look in light of that idea...


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 2:01 pm 
Offline
Senior Newbie

Joined: Thu Dec 16, 2010 11:38 am
Posts: 5
Thanks david, you put me on the right path.

It turns out that in sites-available I'd accidentally linked to the directory of the old site, instead of to the config file inside the directory.

So when I added old.elegantchaos.com to sites-enabled, I was actually adding a link to a link to a directory, instead of a link to a link to a config file. Apache obviously recurses into directories in sites-enabled...

All fixed now.

Thanks again for your help.


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 2:38 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
samdeane wrote:
All fixed now.

So that error message wasn't quite "pointless" :-)

-- David


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 2:45 pm 
Offline
Senior Newbie

Joined: Thu Dec 16, 2010 11:38 am
Posts: 5
db3l wrote:
samdeane wrote:
All fixed now.

So that error message wasn't quite "pointless" :-)

-- David


I'll get my coat...


Top
   
 Post subject:
PostPosted: Sat Dec 18, 2010 4:32 am 
Offline
Senior Member

Joined: Sat Nov 13, 2010 3:05 am
Posts: 91
Website: http://www.graq.co.uk
Here, it's snowing out there, take this hat and scarf too :)


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


Who is online

Users browsing this forum: No registered users and 1 guest


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