configure localhost with alias like www.xxxyyyy.xom

Posted on 2014-03-25
Medium Priority
Last Modified: 2014-05-03

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?
Question by:Rocking
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 39954836
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       xxxyyyy.com

then add it to the iis

 Open IIS admin and add a "xxxyyyy.com" website.

Author Comment

ID: 39954842
i want to configure it through tomcat server.xml file using host tag.

Expert Comment

ID: 39954849
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 *:80>
DocumentRoot /www/example2
ServerName www.example.org

# Other directives here

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.


Author Comment

ID: 39954851
Is the configuration for apache web server and tomcat server are same?
Since i am using apache tomcat server 5 not apache server

Expert Comment

ID: 39954857
apache is the web server and tomcat is the servlet engine.  You should do this in apache/tomcat.
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39954860
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.

Author Comment

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

<Host name=" www.example.com

If i write on browser this url it goes to the internet searching for the domain instead of going to local host?
LVL 35

Accepted Solution

Gary Patterson earned 2000 total points
ID: 40016043
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 (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.

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

770 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