Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:configure_access_restrictions_on_directories [2018/04/07 23:35] billdozor [Setup Directory and SELinux] |
linux_wiki:configure_access_restrictions_on_directories [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: | ||
+ | * Except leave listening on port 80/tcp | ||
+ | * [[linux_wiki: | ||
---- | ---- | ||
Line 74: | Line 79: | ||
\\ | \\ | ||
- | Create a private file | + | Create a private |
<code bash> | <code bash> | ||
echo "This is for certain people to view only." > / | echo "This is for certain people to view only." > / | ||
Line 94: | Line 99: | ||
restorecon -Rv / | restorecon -Rv / | ||
</ | </ | ||
+ | * Reminder: man semanage-fcontext | ||
===== Restrict Access ===== | ===== Restrict Access ===== | ||
+ | **Help**: Available if you installed ' | ||
+ | |||
+ | \\ | ||
+ | Create password for the user | ||
+ | <code bash> | ||
+ | htpasswd -c / | ||
+ | </ | ||
+ | * Prompted for a password | ||
+ | |||
+ | \\ | ||
Edit the vhosts.conf file and add this additional Directory part in the redsite virtualhost | Edit the vhosts.conf file and add this additional Directory part in the redsite virtualhost | ||
<code bash>vim / | <code bash>vim / | ||
Line 108: | Line 124: | ||
AuthType Basic | AuthType Basic | ||
AuthName " | AuthName " | ||
- | AuthUserFile "/ | + | AuthUserFile "/ |
Require valid-user | Require valid-user | ||
</ | </ | ||
</ | </ | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create password for the user | ||
- | <code bash> | ||
- | htpasswd -c / | ||
- | </ | ||
- | * Prompted for a password | ||
- | |||
- | \\ | ||
- | Change permissions on the userdb file | ||
- | <code bash> | ||
- | chown :apache / | ||
- | chmod 640 / | ||
</ | </ | ||
Line 137: | Line 139: | ||
Visit restricted directory | Visit restricted directory | ||
<code bash> | <code bash> | ||
- | elinks http://testsite.example.com/ | + | elinks http://redsite.example.com/ |
</ | </ | ||
* elinks may need to be installed first (yum install elinks) | * elinks may need to be installed first (yum install elinks) |