enableing server side includes

Posted on 2006-03-20
Medium Priority
Last Modified: 2013-11-18
I just setup a new linux server and for some reason apache isn't allowing server side includes to work. how do I enable this?
Question by:battalion
  • 4
  • 2
LVL 15

Expert Comment

ID: 16239479
You should look into your Apache configuration file (httpd.conf).

Look for a line which starts:

AllowOverride (...)

AllowOverride controls which options the .htaccess in directories can override.  It can be set to All, or any combination of Options, FileInfo, AuthConfig and Limit.

For example:

AllowOverride All

You can set this by default, or by individual VirtualHost containers.

Additionally, the name of the .htaccess file is controlled by the AccessFileName directive;  typically, it's set as follows:

AccessFileName .htaccess

Author Comment

ID: 16239620
below is the setup for my httpd.conf file.

<Directory "/web/Intranet">
    AllowOverride All
    allow from all
    Options +Indexes

    DocumentRoot /web/Intranet    
    ServerName intranet
LVL 15

Expert Comment

ID: 16239644
I'd put the AllowOverride All in the VirtualHost container, too.  Is there an AccessFileName directive?
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

LVL 27

Expert Comment

ID: 16239646
did you enable

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

in your httpd.conf, too? May be just uncomment both lines in your httpd.conf.

Author Comment

ID: 16239665
they are uncommented
LVL 15

Accepted Solution

periwinkle earned 2000 total points
ID: 16239793
My apologies - clearly I read the question and then answered another.  You want server side includes to work.

That requires not AllowOverrides (which is what enables .htaccess files), but the following:

Options Includes

Change your Options statement to:

Options Includes +Indexes
LVL 15

Expert Comment

ID: 16240178
I'm so glad to have helped - sorry for the initial miscue!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question