Solved

configure localhost with alias like www.xxxyyyy.xom

Posted on 2014-03-25
10
793 Views
Last Modified: 2014-05-03
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?
0
Comment
Question by:Rocking
10 Comments
 
LVL 2

Expert Comment

by:rrococi2
Comment Utility
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.
0
 

Author Comment

by:Rocking
Comment Utility
i want to configure it through tomcat server.xml file using host tag.
0
 
LVL 2

Expert Comment

by:rrococi2
Comment Utility
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>
0
 

Author Comment

by:Rocking
Comment Utility
Is the configuration for apache web server and tomcat server are same?
Since i am using apache tomcat server 5 not apache server
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 2

Expert Comment

by:rrococi2
Comment Utility
apache is the web server and tomcat is the servlet engine.  You should do this in apache/tomcat.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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.
0
 

Author Comment

by:Rocking
Comment Utility
@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?
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
Comment Utility
I think you have this backwards.  See if I understand correctly:

You are running Apache locally on your machine.

When testing on your machine, you want references to www.example.com to resolve to your local machine instead of resolving to an internet address.

If that's correct, then you need to set up a Hosts entry on your machine for www.example.com, and set it to resolve to 127.0.0.1 (that's the numerical equivalent of localhost).

That way when your machine sees www.example.com, it will resolve to the localhost.

This works because DNS clients search the Hosts file before trying to do a DNS lookup.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now