linux - virtualhost without real domain name -


i've configuration virtual host , runs real domains. testing purpose need create same virtual host non real domain (i.e. domain10). considerated browser check name of domain of virtual host, think using 127.0.0.1. i've no idea realize this.

<virtualhost *:80> serveradmin info@domain10.org servername domain10.org serveralias domain10.org  directoryindex index.html index.htm index.php documentroot /home/domain10.org/  <directory /home/domain10.org/> options -includes -indexes -followsymlinks -execcgi +multiviews allowoverride none order allow,deny allow </directory> </virtualhost> 

you can use /etc/hosts file purpose. there should line in beginning 127.0.0.1. add domain10.org list of hosts resolves address.

for example, if existing line is:

127.0.0.1 localhost localhost.localdomain 

just extend to:

127.0.0.1 localhost localhost.localdomain domain10.org 

then (on machine only) domain10.org resolve 127.0.0.1. if testing on same machine, can enter http://domain10.org/ in browser reach local web server.


if need reach host on internet, different approach needed. line external ip address of server in /etc/hosts file , modify similar above instructions. if such line not exist, add one.

on client machine, same (using /etc/hosts linux box or %windir%\system32\drivers\etc\hosts windows box). should able reach server client using name.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -