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 02-07-2010, 08:25 AM   #1
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Rep: Reputation: 15
Red face Virtual hosting with no domain name


Hi all,

Just wondering if it's possible to do virtual hosting without a registered domain name. I'm running slackware 13 and just trying to do it like this in my vhost config:

192.168.15.149/test1.php

and

192.168.15.149/test2.php

Thanks
 
Old 02-07-2010, 01:28 PM   #2
nicedream
Member
 
Registered: Feb 2010
Distribution: Arch Linux
Posts: 68

Rep: Reputation: 19
The whole point of virtual hosting is so you don't need a new IP address for every domain. The client requests a specific site, and the host returns the site that is requested.

Since you don't have a domain name, all you're doing is making different php pages on the same server.
 
Old 02-07-2010, 08:08 PM   #3
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
so is it possible? is there any work around that I can run virtual host on my machine w/o a real registered domain name?

Thanks in advance
 
Old 02-07-2010, 09:37 PM   #4
nicedream
Member
 
Registered: Feb 2010
Distribution: Arch Linux
Posts: 68

Rep: Reputation: 19
Technically, I guess you could if you had more than one IP address. Each IP could be a separte vhost.

But in the example you gave, you are specifying the same host: 192.168.15.149. The only differences are *which* php files you are requesting from the host, but the host is the same.

What exactly are you trying to achieve here?
 
Old 02-08-2010, 08:46 AM   #5
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
Hi Nicedream,

Thanks for the quick reply. I only want to run two virtual test server in one machine. Since I don't want to register a domain name yet I was hoping that I could use ip addressing/local address for now. Now that you mentioned "same host" it gave me an idea that it's almost impossible. What I'm thinking now is adding another NIC onto my machine. Still I'm not sure if it will work but I'll try and I'll let you know what happen.


Ciao
 
Old 02-08-2010, 08:55 AM   #6
nicedream
Member
 
Registered: Feb 2010
Distribution: Arch Linux
Posts: 68

Rep: Reputation: 19
FYI: You can have multiple IP addresses listening on the same physical NIC.

Also, You may be able to do virtual hosting on the same IP using different ports for each vhost. I just thought of that.
 
Old 02-08-2010, 10:09 AM   #7
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
I think you can do what you want to do in two different ways.
  • Use /etc/hosts to assign two names to one machine. Of course this will only be accessible on machines that have a modified /etc/hosts file.
  • Use a free service such as No-IP, ChangeIP, or FreeDNS to assign multiple real DNS names to one IP address--even a local IP.
 
Old 02-08-2010, 11:08 AM   #8
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
I'm not sure what the OP is trying to achieve that can't be done equally well by just putting each site in its own directory.
 
Old 02-08-2010, 12:20 PM   #9
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
I just had a peek on one of KenJackson's link and I think I'll try free dns. I really have a feeling that it would solve the problem....

Ciao for now... I'll keep you guys posted.
 
Old 02-09-2010, 11:00 PM   #10
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
okay guys,

I have obtained two subdomains from freedns they are

slackpro.mooo.com
and
grocer.mooo.com

are these okay to be virtual hosted? coz I have enabled "include vhost" from my httpd.conf and modify httpd-vhost as necessary but every time I point my browser to one of my site the apache is pointing at the default web page apache has that say's "it work's".

domain names i think are okay coz when I try them w/o enabling vhost they are displaying the good index from where I point httpd.conf.

I really think there's just a little bit configuration missing...


thanks in advance
 
Old 02-10-2010, 04:51 AM   #11
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by Allanitto Newbee View Post
I really think there's just a little bit configuration missing...
You are probably, right. My brief attempt at virtual hosting convinced me that it's tricky.

BTW, did you know that you already have your IP in DNS? Most ISPs seem to register every address, though it's of limited use since you have to know the IP. Check out cable-12-110-7.b2b2c.ca.
 
Old 02-10-2010, 05:32 AM   #12
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
Quote:
Originally Posted by Allanitto Newbee View Post
okay guys,

I have obtained two subdomains from freedns they are

slackpro.mooo.com
and
grocer.mooo.com

are these okay to be virtual hosted? coz I have enabled "include vhost" from my httpd.conf and modify httpd-vhost as necessary but every time I point my browser to one of my site the apache is pointing at the default web page apache has that say's "it work's".

domain names i think are okay coz when I try them w/o enabling vhost they are displaying the good index from where I point httpd.conf.

I really think there's just a little bit configuration missing...


thanks in advance
can you post your configuration?
 
Old 02-10-2010, 08:58 AM   #13
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
Hi Ken,

Yes, DNS is connected to my IP already. I did this yesterday:
in windozeee zzz......

>nslookup

>server ns1.afraid.org
=Default server: ns1.afraid.org
address: 67.19.72.206

>slackpro.mooo.org
=Server: ns1.afraid.org
address: 67.19.72.206

=name: slackpro.mooo.com
address: 72.12.110.7

same result if I do it with the other one which is grocers.mooo.org


Hi nowonmai,

I'll post my config when I get home but I'm pretty sure that I only modify as little as I could in htttpd.conf and httpd-vhost.com aside from creating a totally different folder for those two sites. Instead of putting it somewhere in var/www/httpd/public_html or something like the default folder that apache created I put it in /usr/local/public_www/site1 and site2 which of course I pointed my httpd-vhost.conf to those folders. Note that I did not modify anything in httpd.conf aside from enabling httpd-vhost.conf somewhere in the last part of the script.

anyways... I'll post my config tonight.


Thanks guys
 
Old 02-10-2010, 09:31 AM   #14
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
One more thing people... How important is "serveralias" in this case?
do I have to add lines in "hosts" config?

thanks
 
Old 02-10-2010, 11:25 AM   #15
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
Do I need to use "web forward" like the one in afraid.org? I have read a thread just now here in linuxquestions and I think we do have a similar problem.

Thanks
 
  


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
Dynamic Virtual Hosting with Multiple Domain Names bahbahthelamb Linux - Server 6 02-10-2010 12:43 PM
Virtual domain hosting with dns setup cool47 Linux - Networking 5 01-18-2010 01:16 PM
postfix virtual hosting problem - mail for domain.com loops back to myself ddaas Linux - Server 4 12-28-2008 08:50 PM
Virtual hosting/ domain question Kovacs Linux - Networking 2 11-23-2004 05:55 AM
apache virtual hosting / point more than one domain to my single IP? rioguia Linux - Networking 1 09-27-2002 06:18 PM

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

All times are GMT -5. The time now is 10:15 AM.

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