Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Expert on Apache wanted
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Re: Expert on Apache wanted
Expert on Apache wanted
02-08-2007 11:12 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Where to start
I run a website for my Model Railway club www.hmrg.co.uk and the site was getting quite large so I decided to make use of SSI so that I could make global changes by including a standard header on every page with the html code <!--#include virtual="header1.inc"--> and included the relevant .htaccess file "AddType text/html .html .htm AddHandler server-parsed .html .htm".
This all works well on the Plusnet server and maked changing the buttons and links on all the pages a doddle.
However there is a snag in that I have to upload the changed "header1.inc" file in order to see that the changes are what I wanted.
To overcome this I have downloaded and installed Apache Version 2.2.4 on my main PC. so that I could see the changes locally.
Apache works ok but I cannot make it run the <!--#include virtual="header1.inc"--> line when it loads a html file and it just ignores it.
The config file I have for apache can be seen here
I have tried everything I can think of and as far as I can see I have included everthing I need to so that it works with the SSI locally.
I would be very grateful if anyone can shed any light on why it is ignoring the include command
I run a website for my Model Railway club www.hmrg.co.uk and the site was getting quite large so I decided to make use of SSI so that I could make global changes by including a standard header on every page with the html code <!--#include virtual="header1.inc"--> and included the relevant .htaccess file "AddType text/html .html .htm AddHandler server-parsed .html .htm".
This all works well on the Plusnet server and maked changing the buttons and links on all the pages a doddle.
However there is a snag in that I have to upload the changed "header1.inc" file in order to see that the changes are what I wanted.
To overcome this I have downloaded and installed Apache Version 2.2.4 on my main PC. so that I could see the changes locally.
Apache works ok but I cannot make it run the <!--#include virtual="header1.inc"--> line when it loads a html file and it just ignores it.
The config file I have for apache can be seen here
I have tried everything I can think of and as far as I can see I have included everthing I need to so that it works with the SSI locally.
I would be very grateful if anyone can shed any light on why it is ignoring the include command
Message 1 of 9
(6,803 Views)
8 REPLIES 8
Re: Expert on Apache wanted
02-08-2007 11:41 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I'm assuming you're using unix at home - some of these suggestions will require translating into a windows environment
Firstly, ensure that mod_include is loaded. You should have the following line (or similar) in your httpd.conf:
LoadModule include_module modules/mod_include.so
If you have PHP enabled on the server, you can check the status of loaded modules by creating a text file called "phpinfo.php" in your web root containing:
This will show you a screen with a summary of PHP and Apache modules loaded. If you're using Apache2, you should have an "apache2handler" section, and loaded modules will show "mod_include" listed.
As long as mod_include is listed, it may then be a permissions problem. Check the access_log and error_log files to see whether there are any telling signs that it cannot find the correct files, or cannot open them. (I believe it will complain about an fopen() call failing, but my memory is failing somewhat!)
If that still doesn't help, post back and we'll dig on further!
B.
Firstly, ensure that mod_include is loaded. You should have the following line (or similar) in your httpd.conf:
LoadModule include_module modules/mod_include.so
If you have PHP enabled on the server, you can check the status of loaded modules by creating a text file called "phpinfo.php" in your web root containing:
<?php
phpinfo();
?>
This will show you a screen with a summary of PHP and Apache modules loaded. If you're using Apache2, you should have an "apache2handler" section, and loaded modules will show "mod_include" listed.
As long as mod_include is listed, it may then be a permissions problem. Check the access_log and error_log files to see whether there are any telling signs that it cannot find the correct files, or cannot open them. (I believe it will complain about an fopen() call failing, but my memory is failing somewhat!)
If that still doesn't help, post back and we'll dig on further!
B.
Message 2 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 12:06 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: zubel I'm assuming you're using unix at home - some of these suggestions will require translating into a windows environment
Using the Apache version for windows on Xp and "LoadModule include_module modules/mod_include.so" is in the config file.
the file "mod_include is also listed in the "Modules" folder
No messages of complaint seem to be visable in the error logs.
Message 3 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 12:14 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
did you try the phpinfo() to see if it's being loaded correctly?
Message 4 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 12:26 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've just checked your httpd file. It seems that the Option statement isn't set correctly.
Find the line:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
just beneath that is an Options directive:
Options Indexes FollowSymLinks
Change this to:
Options Indexes FollowSymLinks +Includes
Save the file, restart httpd and see if that makes a difference.
B.,
Find the line:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
just beneath that is an Options directive:
Options Indexes FollowSymLinks
Change this to:
Options Indexes FollowSymLinks +Includes
Save the file, restart httpd and see if that makes a difference.
B.,
Message 5 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 12:36 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Didn't try the php suggestion as I don't have php on the system yet.
I will have a look at the setting you suggested but I have to go out for a while now and will let you know later how I get on.
Thanks for the help so far
I will have a look at the setting you suggested but I have to go out for a while now and will let you know later how I get on.
Thanks for the help so far
Message 6 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 12:39 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
You should also remove the stray "Options Includes" from earlier in the file (just after the "Listen 80" line)
That change you made precedes the "default declaration" in the httpd.conf file. The default declaration then overrides your Options Includes which is probably why it's not parsing them correctly.
The Apache httpd.conf file is parsed "top down", so any later declarations override earlier ones.
Making the change I pointed out above, (preceding the word Includes with a '+') means it will apply to the DocumentRoot, and all subdirectories. Without the '+' it will only apply to the specific directory it is granted to.
B.
That change you made precedes the "default declaration" in the httpd.conf file. The default declaration then overrides your Options Includes which is probably why it's not parsing them correctly.
The Apache httpd.conf file is parsed "top down", so any later declarations override earlier ones.
Making the change I pointed out above, (preceding the word Includes with a '+') means it will apply to the DocumentRoot, and all subdirectories. Without the '+' it will only apply to the specific directory it is granted to.
B.
Message 7 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 2:54 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
zubel you are indeed a genius.
I decided to ditch the config file and start with the default one (which I had saved) and then made the changes you listed.
It works a treat.
Many many thanks for your help
I decided to ditch the config file and start with the default one (which I had saved) and then made the changes you listed.
It works a treat.
Many many thanks for your help
Message 8 of 9
(2,445 Views)
Re: Expert on Apache wanted
02-08-2007 2:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
My pleasure
B.
B.
Message 9 of 9
(2,445 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Re: Expert on Apache wanted