Archive for the ‘Apache’ Category

Protect web pages with username/password

Monday, September 29th, 2008

If there some web pages you want to protect with username/password, all you have to do is to create a file called .htaccess under the directory to protect with the following lines: AuthUserFile /path/to/htpasswd/.htpasswd AuthGroupFile /dev/null AuthName "Restricted Directory" AuthType Basic <Limit GET POST> require valid-user </Limit> Replace /path/to/htpasswd/ with the .htpasswd path. Replace Restricted Directory with the text ...

Configure Apache to serve PERL pages ( Ubuntu )

Friday, May 30th, 2008

I just reinstalled my ubuntu distribution, and have to configure apache to serve perl pages outside of the cgi-bin directory, after a little bit of googling i found the solution. You have to edit the /etc/apache2/apache2.conf and add to it the following lines. AddHandler cgi-script .cgi .pl Options +ExecCGI Options +ExecCGI

Stop apache showing incomplete urls

Thursday, May 22nd, 2008

Apache was showing files even if i didn't put the extension on the url, that behavior was messing with a mod rewrite rule i was working on. To solve this we just add the line below to the .htaccess file and that's it apache will stop showing incomplete urls Options ...

Force download in apache

Wednesday, February 27th, 2008

if you want to force certain kind of files to pop up the save as dialog box, you have to add the AddType directive with the value application/octet-stream to the .htaccess file like this: AddType application/octet-stream .csv AddType application/octet-stream .xls AddType application/octet-stream .doc AddType application/octet-stream .avi AddType application/octet-stream .mpg AddType application/octet-stream .mov AddType application/octet-stream .pdf and that's ...

Configure ubuntu to use mod_rewrite

Tuesday, February 12th, 2008

To enable mod_rewrite on Ubuntu is pretty easy what we have to do is, first we enable the apache module for mod rewrite with this line. sudo a2enmod rewrite After that we have to edit the file /etc/apache2/sites-avalible/default, then we look for this: Options Indexes FollowSymLinks MultiViews ...