Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache/Perl Include Virtual Directive

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
OK i used to use a script that was run by using <!-- include virtual blah
blah blah --> in the html.
Now I have just installed a new Linux/Apache web server and it won't execute
this script but it does execute others that are ran in the 'usual' fashion.
I realise (should that be hope?) that this is a simple configuration issue,
can anyone tell me where to enable support for this kind of script
execution.

Thanks in advance!!
 
Maybe you didn't enable server-side-include module in your httpd.conf file. Just look for the following lines and remove the comment (#):

LoadModule includes_module lib/apache/mod_include.so
AddModule mod_include.c

AddType text/html .shtml
AddHandler server-parsed .shtml

Also make sure you add the 'Includes' to your root document directive:

<Directory &quot;your/root/path&quot;>
Options Includes
</Directory>

Make all these changes and restart Apache. It should work.


ttest
thum@starwarsfan.com

 
All these are enabled and it still doesn't work. Still just shows up <!--#include virtual=&quot;/cgi-bin/ip.cgi&quot; --> in the page source instead of the output of that script.
 
Is your file saved as .shtml? The following line specifies that apache should only parse those files ended with .shtml

AddHandler server-parsed .shtml

If your files are saved as .html, you can either rename your files to .shtml OR (if that is a lot of work) just change the above line to

AddHandler server-parsed .html


If it is not the filename, then maybe you can look for a .htaccess file in your web root directory. If there is a .htaccess file, edit it and see if it contains any <Directory> command in it. Just add the 'Includes' into the 'Options'.

ttest
thum@starwarsfan.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top