Difference between revisions of "Adding Apache Shares"
Jump to navigation
Jump to search
(Created page with 'On the webserver, the private apache shares are under /var/www_private We can create a new share with the following proceedure: mkdir testshare chown wwwprivate:wwwprivate te...') |
m (Protected "Adding Apache Shares" ([edit=comp] (indefinite) [move=comp] (indefinite) [read=comp] (indefinite))) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | On the webserver, the private apache shares are under | + | 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'''. |
− | /var/ | ||
− | + | ||
+ | 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. Reload apache to activate the configuration changes: | ||
+ | /etc/init.d/apache2 reload | ||
+ | |||
+ | 3. Create a new directory for the files: | ||
+ | cd /var/www_private | ||
mkdir testshare | mkdir testshare | ||
chown wwwprivate:wwwprivate testshare | chown wwwprivate:wwwprivate testshare | ||
+ | |||
+ | 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/ http://www.iac.isu.edu/private/testshare/] |
Latest revision as of 02:09, 31 December 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. Reload apache to activate the configuration changes:
/etc/init.d/apache2 reload
3. Create a new directory for the files:
cd /var/www_private mkdir testshare chown wwwprivate:wwwprivate testshare
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/