I'm running CentOS 5.6 on my server with Apache. I need to create a "staging" site so that client can view the development in progress. I understand that this is done via Apache virtual host. Where is this file located on the server?
Since we have 1 IP address on the test server, and we don't want to change DNS for the domain name just yet, how do I setup the virtual host to resolve the http://my.ip.addy to our test server's /var/www/html/public directory?
Thanks much for your guidance.
The configuration file is /etc/httpd/conf/httpd.conf and you can use the minimal virtualhost as follows,
More Info: http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-apache-config.html
It sounds like you are trying to get a domain name to resolve to an IP as well as getting the computer at that IP to respond appropriately. To do that you want to modify your httpd.conf file, which is located at
/etc/httpd/conf/
by default. You would then add the following at the bottom:For
ServerName
you put whatever you want as a domain. Changing the*:80
toyour.ip.add.ress:80
means that the machine will only respond by theServerName
provided if the request is to that IP (You may want that too, but I generally avoid it).Then, on the client side, I would modify the
hosts
file to point that domain to the IP of the testing server. This will let you navigate to the domain and arrive at the testing site. It might be something like this: