Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have the backup archives in some linux folder.


Now i want make the web interface from which user can download those files.

is there any way that that i can have username and password and that user can download that file

Just like in cpanel

share|improve this question
up vote 3 down vote accepted

This will let you create the alias so that will work.

Alias /backups "/backups"
<Directory "/backups">
    AllowOverride None
    Options Indexes
    Order allow,deny
    Allow from all

To turn on password prompts, put the following in /backups/.htaccess:

[kevin@box backups]$ cat .htaccess
AuthType Basic
AuthName "_password prompt text_"
AuthUserFile /var/www/conf/backup-user-file
AuthGroupFile /var/www/conf/backup-group-file
Require group backup-users
[kevin@box backups]$

The backup group file, equivalent to /etc/group, can just be created.

[kevin@box choir]$ cat /var/www/conf/backup-group-file
backup-users: backup-user-1 backup-user-2

The backup user file must be created using the htpasswd utility. The first time you run it, you will need to do so with the -c(create a new file) option.

[kevin@box backups]$ htpasswd -c /var/www/conf/backup-user-file backup-user-1
New password:
Re-type new password:
Adding password for user backup-user-1
[kevin@box backups]$ htpasswd /var/www/conf/backup-user-file backup-user-2
New password:
Re-type new password:
Adding password for user backup-user-2
[kevin@box backups]$
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.