Difference between revisions of "Adding Apache Shares"
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
chown wwwprivate:wwwprivate testshare | chown wwwprivate:wwwprivate testshare | ||
− | 3. Create an apache password for the new share and add the first user: | + | 3. Reload apache to activate the configuration changes: |
+ | /etc/init.d/apache2 force-reload | ||
+ | |||
+ | 4. Create an apache password for the new share and add the first user: | ||
htpasswd -c /var/www_passwd/testshare.pwd iacadmin | htpasswd -c /var/www_passwd/testshare.pwd iacadmin | ||
New password: | New password: | ||
Line 22: | Line 25: | ||
Adding password for user iacadmin | Adding password for user iacadmin | ||
− | + | 5. Add other users: '''note the lack of the -c argument which would erase an existing file''' | |
htpasswd /var/www_passwd/testshare.pwd brian | htpasswd /var/www_passwd/testshare.pwd brian | ||
New password: | New password: | ||
Line 28: | Line 31: | ||
Adding password for user brian | Adding password for user brian | ||
− | + | 6. Add symlinks so users can find the share easier when logging in: ''optional'' | |
cd ~ashley/ | cd ~ashley/ | ||
ln -s /var/www_private/testshare/ testshare | ln -s /var/www_private/testshare/ testshare | ||
ls -l | ls -l | ||
''lrwxrwxrwx 1 root root 27 2010-01-15 15:40 testshare -> /var/www_private/testshare/'' | ''lrwxrwxrwx 1 root root 27 2010-01-15 15:40 testshare -> /var/www_private/testshare/'' | ||
+ | |||
+ | 7. The new share is ready! The link is [http://www.iac.isu.edu/private/testshare/ http://www.iac.isu.edu/private/testshare/] |
Revision as of 21:54, 15 January 2010
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. Reload apache to activate the configuration changes:
/etc/init.d/apache2 force-reload
4. 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
5. 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
6. Add symlinks so users can find the share easier when logging in: 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/
7. The new share is ready! The link is http://www.iac.isu.edu/private/testshare/