How to allow includes, Basic Auth from outside .htaccess

This .htaccess file does the following:

Allow SSI lines 1/2/3

Reauire Authenitcation for all outside except those from a particular IP the rest ..

Options +Includes      
AddType text/html .shtml .html
AddOutputFilter INCLUDES .shtml .html
AuthType Basic
AuthName “Password Required For INGG Monitor”
AuthUserFile /var/www/passwords/password.file
Require valid-user
Order deny,allow
Deny from all
Allow from 323.365.376.398
Satisfy any
Header set Access-Control-Allow-Origin “*”
~

 

you need to enable the headers module (mod_Headers)

In Ubuntu :

cd /etc/apache2/mods-enabled/

ln -s ../mods-available/headers.load headers.load 

nJoy 😉

 

Enable SSI on Apache2 under Ubuntu

Tested on:
– Ubuntu Linux 10.10 Maverick Meerkat (2010-11-21)
– Ubuntu Linux 7.10 Gutsy Gibbon
– Ubuntu Linux 6.06 Dapper Drake
– Ubuntu Linux 5.10 Breezy Badger

 

1)  Optional: Install the Apache2 httpd server if not already installed.

sudo apt-get install apache2

2) Create the following symlink.
sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled

3) Open the /sites-available/default file and add the text with the yellow background.
sudo gedit /etc/apache2/sites-available/default

...
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
...

4) Restart Apache2 and create a SSI test file (ssi-test.shtml) and save it in the directory /var/www/.

sudo apache2ctl restart

sudo vim /var/www/ssi.shtml

<html>
<head>
<title>SSI Page</title>

</head>
<body>
<!--#echo var="DATE_LOCAL" -->
</body>
</html>

5) Test SSI in your web browser.
http://localhost/ssi.shtml

If your browser displays the local date (eg Monday, 29-Jul-2013 14:32:58 BST), SSI would be working.

Yeah !!

nJoy 😉