nerdexam
Red_Hat

EX300(23Q) · Question #14

Create a directory named as "owndir" under the document root of webserver rename the file into index.html The content of the owndir should be visible to everyone browsing from your local system but…

mkdir -p /var/www/owndir restorecon -Rv /var/www/owndir cd /var/www/html/owndir wget http://station.network0.example.com/pub/rhce/restrict.html mv restrict.html index.html vi /etc/httpd/conf.d/server1.conf (Add this) <Directory "/var/www/html/owndir"> AllowOverride None Require…

Configure Apache HTTP Server

Question

  • Create a directory named as "owndir" under the document root of webserver
  • rename the file into index.html
  • The content of the owndir should be visible to everyone browsing from your local system but should not be accessible from other location

Explanation

mkdir -p /var/www/owndir restorecon -Rv /var/www/owndir cd /var/www/html/owndir

wget http://station.network0.example.com/pub/rhce/restrict.html mv restrict.html index.html

vi /etc/httpd/conf.d/server1.conf (Add this) <Directory "/var/www/html/owndir"> AllowOverride None Require all Denied Require local </Directory>

systemctl restart httpd

Topics

#Apache directory listing#localhost access restriction#Options Indexes#Require directive

Community Discussion

No community discussion yet for this question.

Full EX300(23Q) Practice