linux_wiki:configure_group-managed_content

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:configure_group-managed_content [2018/04/08 00:06]
billdozor [Basic Apache Directory Setup]
linux_wiki:configure_group-managed_content [2019/05/25 23:50] (current)
Line 12: Line 12:
   * server1.example.com (192.168.1.150) -> Perform all connectivity tests from here   * server1.example.com (192.168.1.150) -> Perform all connectivity tests from here
   * server2.example.com (192.168.1.151) -> Install Apache Web Server here   * server2.example.com (192.168.1.151) -> Install Apache Web Server here
 +
 +
 +**Previous Sections Completed**
 +  * [[linux_wiki:network_services_overview_apache_web_server|Install/Configure]]
 +    * Except leave listening on port 80/tcp
 +  * [[linux_wiki:configure_a_virtual_host|Virtual Host Config]]
 +  * [[linux_wiki:configure_access_restrictions_on_directories|Access Restrict Directory]]
  
 ---- ----
Line 19: Line 26:
 Create directory to use Create directory to use
 <code bash> <code bash>
-mkdir /data/redsite/group+mkdir /data/redsite/devel-group
 </code> </code>
  
 \\ \\
-Create group that will have access to the directory to manage the content+Create users and a developers group that will have access to the directory to manage the content
 <code bash> <code bash>
-groupadd dbadmins+useradd robert 
 +useradd steve 
 +groupadd developers
 </code> </code>
  
Line 31: Line 40:
 Add users to the group Add users to the group
 <code bash> <code bash>
-usermod -G dbadmins user1 user2+usermod -G developers robert 
 +usermod -G developers steve
 </code> </code>
  
Line 37: Line 47:
 Set permissions of new directory Set permissions of new directory
 <code bash> <code bash>
-chown :dbadmins /data/redsite/group +chown :developers /data/redsite/devel-group 
-chmod 771 /data/redsite/group+chmod 771 /data/redsite/devel-group
 </code> </code>
  
Line 44: Line 54:
 Create index file Create index file
 <code bash> <code bash>
-echo "Group dbadmins index file" > /data/redsite/group/index.html+echo "Developers index file" > /data/redsite/devel-group/index.html
 </code> </code>
  
Line 51: Line 61:
 ====== Group Protected Setup ====== ====== Group Protected Setup ======
  
-Allow htaccess override for the new group directory+**Help**: Available if you installed 'httpd-manual'<code bash>elinks /usr/share/httpd/manual/howto/auth.html</code> 
 +  * Then follow the "Letting more than one person in" link 
 + 
 +\\ 
 +Create the groupdb file (list group members) 
 +<code bash> 
 +vim /etc/httpd/conf/groupdb 
 + 
 +developers: robert steve 
 +</code> 
 + 
 +\\ 
 +Create the user entries in the userdb password file 
 +<code bash> 
 +htpasswd /etc/httpd/conf/userdb robert 
 +htpasswd /etc/httpd/conf/userdb steve 
 +htpasswd /etc/httpd/conf/userdb monty 
 +</code> 
 +  * Prompted for password each time 
 +  * Give 'htpasswd' the -c argument if the userdb file does not exist to create it. 
 +    * No "-c" the second time because it would overwrite the file instead of add to it. 
 + 
 +\\ 
 +Edit the vhosts.conf and add a directory auth section for the new devel-group directory
 <code bash> <code bash>
 vim /etc/httpd/conf.d/vhosts.conf vim /etc/httpd/conf.d/vhosts.conf
Line 60: Line 93:
   #....SNIP....#   #....SNIP....#
  
-  <Directory /var/private>+  <Directory /data/redsite/devel-group>
     AuthType Basic     AuthType Basic
     AuthName "Group Auth - Enter Credentials"     AuthName "Group Auth - Enter Credentials"
     AuthGroupFile "/etc/httpd/conf/groupdb"     AuthGroupFile "/etc/httpd/conf/groupdb"
     AuthUserFile "/etc/httpd/conf/userdb"     AuthUserFile "/etc/httpd/conf/userdb"
-    Require group dbadmins+    Require group developers
   </Directory>   </Directory>
 </code> </code>
- +  Now only users in the userdb file AND in the "developersgroup are allowed to view the content. 
-\\ +    * robert and steve should be allowed in, monty should be denied.
-Create groupdb file +
-<code bash> +
-vim /etc/httpd/conf/groupdb +
- +
-dbadmins: user1 user2 +
-</code> +
- +
-\\ +
-Create group password db file +
-<code bash> +
-htpasswd -c /etc/httpd/conf/userdb user1 +
-htpasswd /etc/httpd/conf/userdb user2 +
-</code> +
-  * Prompted for password each time +
-  -c -> Create the file +
-  * No "-c" the second time because it would overwrite the file instead of add to it.+
  
 \\ \\
Line 96: Line 113:
 View group protected directory View group protected directory
 <code bash> <code bash>
-elink http://redsite.example.com/group+elinks http://redsite.example.com/devel-group
 </code> </code>
   * Prompted for username/password   * Prompted for username/password
  • linux_wiki/configure_group-managed_content.1523160413.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)