Ravindra Bagale · Cyber Securityसर्व coursesया course चे lessonsशोधाEnglish

Cyber Security · मराठी आवृत्ती

Default index page बदलूया

रवींद्र बागले यांच्या course वर आधारित · सहज मराठीत explanation

या page मध्ये

Browser directory URL मागतो तेव्हा कोणती file वापरायची हे Nginx चं index किंवा Apache चं DirectoryIndex ठरवतं. क्रम महत्त्वाचा: आधी home.html, नसेल तर index.html.

# Nginx – inside the server block
index home.html index.html;          # try home.html first, then index.html

Apache

# Apache – inside VirtualHost or <Directory>
DirectoryIndex home.html index.html

Test page आणि verification

echo '<h1>Welcome – home.html</h1>' | sudo tee /var/www/mysite/home.html
sudo nginx -t && sudo service nginx reload                 # Nginx
sudo apachectl configtest && sudo service httpd reload     # Apache on Amazon Linux
sudo apache2ctl configtest && sudo service apache2 reload  # Apache on Ubuntu
curl -s http://localhost | head -3

तुम्ही वापरत असलेल्या web server साठीच test/reload command वापरा; तीनही services एकाच वेळी चालवण्याची गरज नाही. मागच्या lesson मध्ये root portfolio केला असेल तर example मधला mysite path active root शी जुळवा.

Missing index आणि listing

Index file नसेल आणि autoindex/Indexes enabled असेल तर files ची list दिसू शकते. Listing बंद ठेवा. नेमका missing-index response access rules/try_files वर अवलंबून आहे; साध्या static directory setup मध्ये 403 दिसू शकतो.

Practice

दोन्ही server labs मध्ये home.html पहिली choice करा. योग्य content येतो का तपासा. मग फक्त test home.html हटवा/हलवा आणि index.html fallback चालतो का पाहा.