Difference between revisions of "Adding Apache Shares"

From New IAC Wiki
Jump to navigation Jump to search
m (Protected "Adding Apache Shares" ([edit=comp] (indefinite) [move=comp] (indefinite) [read=comp] (indefinite)))
 
(3 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
  </Directory>
 
  </Directory>
  
2. Create a new directory for the files:
+
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
 
  cd /var/www_private
 
  mkdir testshare
 
  mkdir testshare
 
  chown wwwprivate:wwwprivate testshare
 
  chown wwwprivate:wwwprivate testshare
  
3. Create an apache password for the new share and add the first user:
+
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
  
4. Add other users: '''note the lack of the -c argument which would erase an existing file'''
+
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
  
5. Add symlinks so users can fine the share easier: ''optional''
+
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/]

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/