Link to home
Start Free TrialLog in
Avatar of Rocking
Rocking

asked on

configure localhost with alias like www.xxxyyyy.xom

Hi,

I need to create a alias for the localhost which is configured to run on port 80.
currently it work on http://localhost and the first page is displayed.

how to create alias for this localhost?
Avatar of rrococi2
rrococi2

Try editing you local hosts file. The default location is %SystemRoot%\system32\drivers\etc\hosts in most Windows systems.

Then you simply add the line

127.0.0.1       xxxyyyy.com

then add it to the iis

 Open IIS admin and add a "xxxyyyy.com" website.
Avatar of Rocking

ASKER

i want to configure it through tomcat server.xml file using host tag.
Place this is your host file on apache.  

Server configuration

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com

# Other directives here

</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example.org

# Other directives here

</VirtualHost>
Avatar of Rocking

ASKER

Is the configuration for apache web server and tomcat server are same?
Since i am using apache tomcat server 5 not apache server
apache is the web server and tomcat is the servlet engine.  You should do this in apache/tomcat.
Avatar of Dave Baldwin
Even when you provide an alias for 'localhost', it will still Only be accessible on the machine that the site is on.  It will Not be remotely accessible.  To be remotely accessible, you have to use the network IP address of the machine.  'localhost' is always and Only the machine you are on.
Avatar of Rocking

ASKER

@Dave Baldwin :  I understand the scenario,but i want to just test this in my local machine itself.

<Host name=" www.example.com
      appBase="webapps/jsp-examples"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
        </Host>

If i write on browser this url it goes to the internet searching for the domain instead of going to local host?
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial