Adding Apache Shares

From New IAC Wiki
Revision as of 21:49, 15 January 2010 by Oborn (talk | contribs)
Jump to navigation Jump to search

On the webserver, the private apache shares are under /var/www_private and the apache password hash files are under /var/www_passwd/. The apache configuration file that controls private shares is at /etc/apache2/sites-available/private.


1. Create a new entry in /etc/apache2/sites-available/private

<Directory /var/www_private/testshare/>
       Options +Indexes
       AuthUserFile /var/www_passwd/testshare.pwd
       AuthName "Please Log In"
       AuthType Basic
       require valid-user
</Directory>

2. Create a new directory for the files:

cd /var/www_private
mkdir testshare
chown wwwprivate:wwwprivate testshare

3. Create an apache password for the new share and add the first user:

htpasswd -c /var/www_passwd/testshare.pwd iacadmin
New password:
Re-type new password:
Adding password for user iacadmin

4. Add other users: note the lack of the -c argument which would erase an existing file

htpasswd /var/www_passwd/testshare.pwd brian
New password:
Re-type new password:
Adding password for user brian

5. Add symlinks so users can fine the share easier: optional

cd ~ashley/
ln -s /var/www_private/testshare/ testshare
ls -l
   lrwxrwxrwx 1 root   root       27 2010-01-15 15:40 testshare -> /var/www_private/testshare/