LinuxQuestions.org
Review your favorite Linux distribution.
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 07-28-2008, 02:02 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How to test >1 site on my machine


If i'm making websites and I have more than 1 site on my machine, how do I test them? "localhost" in the browser will only take me to one particular one, I'd like to type in something by name eg. "frogs","apples" etc. - is this possible?
Also can someone actually give me a step by step on how to do that virtual hosting thing in Apache? (I'd really like you tell me, not a URL).


Thanks.
 
Old 07-28-2008, 03:39 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,735

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
If the sites are interactive, try http://search.cpan.org/~petdance/WWW...W/Mechanize.pm if you can handle Perl.
More generally, http://search.cpan.org/~gaas/libwww-...814/lib/LWP.pm or look at wget or curl.
 
Old 07-28-2008, 03:56 AM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
If you are trying to test your named-based virtual domains, you need to add either host entries on the machine you're testing from, or setup an internal DNS system. The /etc/hosts method is best for most people:

from the machine the web server is running on :

/etc/hosts:
127.0.0.1 localhost localhost.localdomain
127.0.0.1 frogs.mydomain.com
127.0.0.1 apples.mydomain.com
...

Last edited by Mr. C.; 07-28-2008 at 12:06 PM.
 
Old 07-28-2008, 10:29 AM   #4
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
wow thanks mr. C what does "127.0.0;1" mean?
 
Old 07-28-2008, 12:06 PM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
The semicolon was a typo, since fixed.

It is the IP address of the loopback interface. This is how networking applications can address the machine itself by using an IP address, and not needing to perform special-case exceptions to do local vs. remote networking. 127.0.0.1 always means "this" machine, on whatever machine you are on. Further, the entire 127.0.0.0/8 network is dedicated to loopback.

All you are doing is creating locally known names that you can use that address servers listening on the loopback interface (which almost all do by default).
 
Old 07-29-2008, 04:19 AM   #6
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
ok and where after that would i put each of the files for the "frogs" website and the "apples" website? (i know what loopback is).
 
Old 07-29-2008, 10:44 AM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Now you're moving from the original top which was how to test virtual hosts, to how do I make virtual hosts.

Other's might be able to give you some pointers to HowTos, or search the forums here.

In a nutshell, you will be creating VirtualHost containers in your apache config. But you have to learn about those first. Where you place each host's files depends on how you setup the virtual hosts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
test squid with only one machine noir911 Linux - Server 4 02-14-2008 04:25 AM
Site to test PopRelay? iamcaper Linux - Newbie 1 09-26-2007 01:01 PM
How to test RIP on Linux Machine amitbhelave Linux - Networking 6 08-28-2007 02:26 AM
Is there any way I can test a port on a remote machine to see whether its open? neocookie Linux - Networking 3 05-09-2007 05:13 PM
Joomla test site at home JimT1951 Mandriva 1 12-28-2006 10:40 AM

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

All times are GMT -5. The time now is 04:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration