Web server tutorial - Part 3
1209600 ; expire
43200 ; default_ttl
@ IN NS kshounish1.linux.com.
1 IN PTR kshounish1.linux.com.
1 IN PTR sudhir.linux.com.
1 IN PTR goldie.linux.com.
1 IN PTR chiku.linux.com.
2 IN PTR sudhu.linux.com.
3 IN PTR chik.linux.com.
4 IN PTR gold.linux.com.
Then /etc/rc.d/init.d/named restart
Remember whenever you edit /etc/httpd/conf/httpd.conf after closing it restart /etc/rc.d/init.d/httpd restart
Password Protection to a Directory
Sometimes people want to get some important information. For this purpose, password authentication can be given to a directory and keep the important file out there, secure.
When we open the httpd.conf file we find something looks like:
make it AllowOverrride all, which means user can set the rules on that directory and override the default configuration for that directory and for that another few things have to be done
This directive means the directory where allowOverride is `ALL', should have the .htaccess in its directory
step vi /home/httpd/html/.htaccess
AuthName password needed
AuthUserFile /home/httpd/html/password(where to keep password)
Then come out from that file and run the command htpasswd -c -m /home/httpd/html/password goldie (remember this login is only for Web not for shell)
Then go to Netscape or IE of any machine and write http://18.104.22.168
It will ask for the password give the login name as goldie and the password as the one, which was given by htpasswd command. And the process is over.
With this we come to end of our three part tutorial on Web server. Hope this guide has helped you understand a Web server and its functioning.