LinuxQuestions.org
Visit Jeremy's Blog.
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 04-27-2007, 08:49 PM   #1
zenerdiode
LQ Newbie
 
Registered: Dec 2000
Location: Hattiesburg ms
Posts: 26

Rep: Reputation: 15
virtual hosts subdomains


I want to run two different webpages on the same server with different hosts. So lets say that I have www.somecrap.com and it points to the same address as www.someothercrap.com. Right now they both show the same thing. How would I be able to make www.somecrap.com show say a website about cars, and www.someothercrap.com show a website about maybe boats?
 
Old 04-28-2007, 01:36 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
ok here we go, follow my example and do with your own setting

I sure u have root access to modified httpd.conf and edit it to suite your need and restart the apache

-----------
NameVirtualHost 192.168.0.11:80

<VirtualHost 192.168.0.11:80>
ServerName www.car.org
ServerAdmin boss@car.org
DocumentRoot /export/home/site/car/www
TransferLog /export/home/site/car/logs/access-log
ScriptAlias /cgi-bin/ /export/home/site/car/www/cgi-bin/
</VirtualHost>

<VirtualHost 192.168.0.11:80>
ServerName www.bot.org
ServerAdmin webmaster@bot.org
DocumentRoot /export/home/site/bot/www
TransferLog /export/home/site/bot/logs/access-log
ScriptAlias /cgi-bin/ /export/home/site/bot/www/cgi-bin/
</VirtualHost>

----------------------

provided directory is create correctly then everything
should be ok and once again follow the setting which is suite
you

go and test, something wrong then ask again
 
Old 04-28-2007, 11:58 AM   #3
zenerdiode
LQ Newbie
 
Registered: Dec 2000
Location: Hattiesburg ms
Posts: 26

Original Poster
Rep: Reputation: 15
You are the bomb!

This worked out fantastic! I didn't have to do much more than cut and paste and now everything works great! Thanks a million!
 
Old 04-28-2007, 01:09 PM   #4
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
welcome,

lol .. im not da bomb and dont scare

just help each other
 
Old 04-30-2007, 12:05 PM   #5
zenerdiode
LQ Newbie
 
Registered: Dec 2000
Location: Hattiesburg ms
Posts: 26

Original Poster
Rep: Reputation: 15
Well maybe I messed up

I have my virtual hosts set up like this

[p]NameVirtualHost *:80

<VirtualHost *:80>
ServerName renalwranglers.gotdns.com
ServerAlias gotdns.com *.gotdns.com
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
ServerName chickens.boldlygoingnowhere.org
DocumentRoot /var/www/htmlchick
</VirtualHost>
[/p]
The first one works very well http://renalwranglers.gotdns.com
The second one however http://chickens.boldlygoingnowhere.org
don't work so well. I keep getting the default page. I have put my content in the directories I specified, and still get that same page. I have changed directories, adjusted permissions, and still no luck. I did tinker with the error file though. I replaced the standard noindex.html file with my content and renamed it noindex.html, and it showed my content but I do not want to run my site out of the /var/www/error directory. As best as I can tell it means that the requests are being directed to the host, but can't find the directory.
 
Old 04-30-2007, 12:29 PM   #6
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
A) let me think short way

------------one-----------
[rou@nc ~]$ nslookup renalwranglers.gotdns.com
Server: 202.188.245.2
Address: 202.188.245.2#53

Non-authoritative answer:
Name: renalwranglers.gotdns.com
Address: 71.230.103.150

--------two--------------------

[rou@nc ~]$ nslookup http://chickens.boldlygoingnowhere.org
Server: 202.188.245.2
Address: 202.188.245.2#53

** server can't find http://chickens.boldlygoingnowhere.org: NXDOMAIN
-----------------------------

look like second one not valid if is that real dom u mention

B) for the best purpose lets move the contain away from /var.
create it in specific users inside the home eg.


<VirtualHost *:80>
ServerName chickens.boldlygoingnowhere.org
DocumentRoot /home/chick/www
</VirtualHost>

ps : add shell access to to chick, let test
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
After trying to make virtual subdomains with mod_rewriting eugene2008 Linux - Newbie 0 09-10-2006 07:43 PM
virtual hosts, virtual ip's? kuplo Linux - Newbie 3 11-29-2005 08:44 PM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 05:53 AM
Virtual hosts Help carminejg3 Linux - Newbie 2 12-22-2004 02:47 PM

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

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