Johan Hartzenberg's picture

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 !

Forum: 
Johan Hartzenberg's picture

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 Davis's picture

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.

Johan Hartzenberg's picture

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.


Johan Hartzenberg's picture

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 Davis's picture

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.

Johan Hartzenberg's picture

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


Johan Hartzenberg's picture

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


Johan Hartzenberg's picture

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.


Add new comment