How to access web server through ip address(not the default site)?
Step1 : check for the package installed or not
#rpm -qa | grep httpd
Step2 : Install the package
#yum install httpd
Step3 : Create the root web directory and a test index.html for this testing.
I want to create my web directory in /ipbasehost
Now create index.html and try to write something in to that file then save the file.
save and exit the file.
Step4 : Now edit the httpd.config file
Go to last line and write the below content
Save the file and exit.
Let me explain above four lines
DirectoryIndex index.html => This indicates what is the default file to be open when this site is accessed. So when you type ip address(here it's 192.168.0.1) in browser it will present with
</VirtualHost> This is to specify the end of that virtual host.
Now save the file and exit.
Step5 : Check for the syntax errors in the httpd.conf file before restarting the apache service.
#httpd -k graceful
Step6 : Now start the service and then add it to booting scripts so that it will start automatically at every boot of the system
#service httpd restart
#chkconfig httpd on
Step7 : Now check the site using 192.168.0.1 ip address in your browser.