Linux Online Advertisement
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Building Embedded Linux Systems

[ About Us ]
[ Home Page ]
[ Advertise ]

Tips: Running a Webserver

Apache

Apache is the most popular software for serving web pages. It is distributed under an open source license.


protecting a web directory

If you want to protect a directory on a webserver by making it necessary to provide a password to access it, you need to do the following:

Create .htaccess in the directory you want to protect and include this information:

AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
AuthName [something to identify this directory]
AuthType Basic

<Limit GET>
require valid-user
</Limit>

Then create the file .htpasswd. This should not be in the actual directory.

htpasswd -c /path/to/.htpasswd [username]

This will prompt you for a password.

To add users, simply remove the '-c' option


[ return to main tips page ]




Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Online Inc.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.