TurnKey Linux Virtual Appliance Library

LAMP appliance - SSI directives being ignored

I have just started using the LAMP appliance, and it works except that Server Side Includes does not work.

I expect the Apache server to include the includes, but in stead it is passing the pages through without any additional processing (This can be seen by looking at the received page source in the browser).  This is on a new LAMP appliance - I have not tried to change any settings.

I see via Webmin -> Servers -> Apache -> Default Server -> Filters, under OUPUT FILTERS, that the default is to have INCLUDES checked (enabled) for .shtml

I also see under Document Options (for default server) that the setting "Server side includes and Execs" is Enabled.  the setting below that is "Server Side Includes", which I have changed to "Enable" as well (as part of trying to make this work)

The other thing I have tried doing in trying to make this work, is to set a directive in /etc/apache2/httpd.conf to be

Options +Includes

I notice that this has changed, probably when I changed the Document Options below, for now the line reads

Options +Includes +IncludesNOEXEC

I don't know the difference between these two options.

Oh, and I have tried one other thing:  I have done "chmod +x *shtml" in my web page directory /var/www/test/

Note:  The website works as expected in nanoweb.  Now I probably need to re-install nanoweb !

Running this in Vbox

This is certainly not a networking issue (I can SSH, SFTP and connect to the Apache server and the webmin port, so I'm sure it is running fine) - but just in case someone does thing it matters, well, this is not running on the metal, it is running as a guest in VirtualBox 4.0.8.


Jeremy's picture

Apache config is not my strong point

So I probably won't be a whole lot of help to you.

But one thing I can say is that in Debian and Debain based distros (such as Ubuntu and therefore TKL) that apache2.conf is the Apache2 config file (not httpd.conf as it is on other distros). The Webmin module should be adjusting this file though so settings in Webmin should be followed by apache properly.

Also as I'm sure you're aware, Apache needs to be restarted for setting changes to be applied. From the commandline: service apache2 restart or Webmin has a button at the bottom of the page.

Sorry I can't be of any real help.

What does "Merge With Parent" mean?

I gather it is not a simple ENABLE or DISABLE of the option, it is instead an "ENABLE Merge With Parent" option...

I have now also tried setting the options in a .htaccess file in /var/www/test, and tried more combinations of the settings under the Document Options, but still no luck.


Correct Config File?

I have been looking at httpd.conf because it is mentioned here:

 

http://httpd.apache.org/docs/2.0/howto/ssi.html

I notice that webmin does indeed make changes to httpd.conf.  The file was 0 bytes when I started though, so i will truncate it and try the apache2.conf file as you suggest.

...{time passes}

OK, no, that did not work.  I moved the Options to the apache2.conf file and truncated the httpd.conf file.  I changed one of the options at the same time - webmin picked the change up, so webmin at least must be looking at both config files.

I restarted apache (using the command-line method as you suggested - previously I've been using the webmin "Save" and "Apply" buttons.

in any case, Thank you for the assistance, please do not hessitate with any more thoughts - I may have been arround Unix for a couple of rounds but I am very new to web site development!

  _J


Jeremy's picture

Ahh so Webmin changes both.

I suspect it does that so that it works with both Debiin based and other distros. I'm not sure of the rationale but as you found httpd.conf is the Apache default config file, but Debian based distros use apache2.conf instead.

Otherwise, sorry but I've no more pearls of wisdom for you. :)

PS If you keep in mind that TKL is very closely based on Ubuntu 10.04/Lucid you will find plenty of really relevant resources. The Ubuntu Server Guide (online) is invaluable IMO.

Thank you Jeremy, your hint

Thank you Jeremy, your hint to look at Ubuntu documentation led me to several posts in the forums saying that other people found a solution using the Wiki page on how to enable SSI.

I folowed the Wiki page and it is now working: https://help.ubuntu.com/community/ServerSideIncludes

Essentially two steps:

run the command a2enmod include

And then a some changes to be made to the DIRECTORY section in the file /etc/apache2/sites-available/default

I will re-start with a fresh copy of the LAMP appliance.  I gather that there may be more to it than just this though - Settings are per-directory?  Per virtual server?  I guess that if this was not a new, fresh install or a complex web site, then the settings would need to be enabled in a different way, eg for only some directories, and/or for only some virtual servers?

Thank you,

  _J


SOLUTION CONFIRMED

OK, I can confirm the solution now.  I re-created the VM with a fresh copy of the appliance vmdk, started it up to set the passwords, and then followed the instructions on this page:

https://help.ubuntu.com/community/ServerSideIncludes

I then copied my website into /var/www/test and opened it up - it worked right away.

Thanx

  _J


Turnkey LAMP SSI failure

Hi,

I wonder if anyone can help?

I have tried just about every concievable option, to get SSI working on Turnkey LAMP appliance - all to no avail.

This includes your solution, from the Ubuntu SSI instruction link - which basically is just an edit of the sites available 'default' file.

The web page displays perfectly - just without the SSI code - even tried the super basic SSI shtml file from the link - again, it displays the page, just not the SSI 'date' content.

 

I have trawled the web for days now trying to get this to work - it can't be this hard? Surely?

Any help anyone can offer would be most appreciated, because I can't be the only person in the known universe trying to get SSI's working on TK LAMP?

 

Many Thanks,

 

Tim.

I will re-check it for you

Right now my virtualbox is not working.  For reasons too irritating to explain right now.

regardless I must fix it, and will do so tonight when I have time.  Then I will check whether the instructions were changed or a new/changed LAMP appliance is now there which might invalidate the solution.

Other than that I fully expect it to work.

I must admit that I've learned since that SSI is simply unneccesary when you are using PHP.  Enabling it means the Apache server must do more checks on every page serve (check whether the page requires SSI parsing, and do it if it does), and worse, setting it on only files with shtml extnetion makes thic checking more efficient, but severely limits you in terms of how you develop your website.  You quickly run into situations where existing pages must be changed to .shtml or vica versa, and this requires you to have to update all your links.  

So all in all not worth the effort for a PHP enabled website.


Thanks

Hi,

Many thanks, but after what you have mentioned, I might use PHP instead...?

All I'm trying to do is wrtite efficient *reusable* code - in the first instance for headers and footers - so that I can make global changes to my websites, by editting a single file. I thought SSI was the way to do this - but i will investigate to see if PHP would be better. (Have tried PHP on an Xampp server and that does not work either - though only a quick test).

Makes me wonder how anyone creates reusable HTML code?

 

Again many thanks for your help,

 

Tim.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)