LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-14-2008, 01:33 PM   #1
rotten_yellow
LQ Newbie
 
Registered: Apr 2008
Posts: 5

Rep: Reputation: 0
hosts conf. file - how to enable subdomains for testing?


Hi!
I notice that I can add different hostnames to point to localhost or different IP's in my /etc/hosts file. For example I can add:
Quote:
127.0.0.1 somename
and I can set up virtual hosts to apache and work on different sites, without them being in the same document root folder and subfolders. Is there a way I can make subdomains work with this?
for example if I go to http://subdomain.somename and it would still work? for now only hostname without subdomains work. Any suggestions? Thanks!
 
Old 06-14-2008, 11:48 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
The hosts file will support this.

It's actually meant to take it in this format:

Code:
IP      hostname.domainname hostname
So you could easily put in a subdomain.

Code:
192.168.1.100      mydomain.domain.com mydomain
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
virtual hosts subdomains zenerdiode Linux - Server 5 04-30-2007 12:29 PM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 05:53 AM
/etc/hosts, /etc/resolve.conf and /etc/host.conf config probs below_average Linux - Networking 1 12-08-2004 10:07 PM
enable changes to /etc/hosts without reboot? vrillusions Linux - Networking 4 05-17-2004 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration