Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-31-2004, 07:36 AM   #1
LQ Newbie
Registered: Jun 2004
Posts: 20

Rep: Reputation: 0
Apache - running multiple websites on one host


Okay, I don't have any problems yet, but I want to start hosting a second website on the same box. I've been looking for howto's but I could not find the info I need.

I already have a fine running website on the machine, and I have the idea that I should add a virtual host.

Can someone point me to a good howto or explain to me what I should do and what happens when I add a virtual host?

I've seen things like name based host and ip based host but I find it all a little scary to change something.


Last edited by xtra; 07-31-2004 at 07:39 AM.
Old 07-31-2004, 09:33 AM   #2
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380

Last edited by win32sux; 07-31-2004 at 09:34 AM.
Old 08-10-2004, 02:42 PM   #3
LQ Newbie
Registered: Jun 2004
Posts: 20

Original Poster
Rep: Reputation: 0
That's all very nice aticles, but it doesn't help me now.

Let's make this an official one....

I use RH9 with Apache updated untill today. I already had one website, a php driven one with mysql integration. I do not run my own DNS, and I prefer not to, even. I simply applied for registration, gave them my IP, and it worked.

So, my website was fine, and a friend asked me if he could run his website on my server. That's when I posted this topic. I read the articles and it did not seem rocket science to me. I told him my IP and he transferred the name to my public IP with his registration service.

So, to make it easy for him, I made him a user account, and I started the http server config tool that came with redhat. I would have preferred to edit httpd.conf myself, but things got weird when I tried to vi httpd.conf, even when the server was stopped. It seems so contain no information, while I'm sure something should be there. Anyway.
I stopped the server, tested if the page was down, and started the config tool.
I told it to listen on all avilable addresses on port 80. I deleted the default virtual host, and made a new one for my own site, based on my old configuration. It is virtual host 0, name based,has a root directory /var/www/html/, IP set to my public IP, and www.hostname.dom as host name. Also I told it to start up with index.php as the main page.

I restarted the web server and yes. My old site was up again.

So, I stopped the web server. I made a new name based virtual host (1). I gave it a root at /home/user/www/ looking for index.html , ip as my public IP, and www.anotherhost.dom as host name. After starting the webserver, my own site was working.

But when I typed in the url of my friends page, I get mine. It will not look in to the right directory, because the only way I can see my friends site is when I take it all and put it in my var/www/html directory while explicitly giving the index.html, but that's all fairly logical.

Now, I really don't understand why it doesn't work... Please help!

Last edited by xtra; 08-10-2004 at 02:44 PM.
Old 08-10-2004, 02:48 PM   #4
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 266Reputation: 266Reputation: 266
Not sure why those articles and links didn't help you but that's what you need to do. Setup a virtual host on your server for his domain.. but you need to have his registrar point to whatever DNS server you have setup, his, yours to point to your actual IP. There has to be a DNS server involved somewhere. Its most likely that your registrar for your own site you registered with has DNS setup since you have them your IP.

But if he registered his domain, he needs to have them point the name to his correct DNS servers which in turn point to the server its hosted on.. which is yours.
Old 08-10-2004, 03:21 PM   #5
LQ Newbie
Registered: Jun 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Thank you!

With the statement that the articles did not help me, is that I could not find in them what was going wrong... But they were very useful, don't get me wrong!

I'll have him enter my full DNS hostname with the registrar, and see what happens...

I will post what happened.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running multiple SSL websites on one server tictocdoc Linux - Networking 1 07-07-2004 03:26 PM
How to host two websites on one computer klintonray Linux - Software 8 07-23-2003 02:19 PM
I want to host Websites king_trance Linux - Networking 2 07-04-2002 01:06 AM
How-to setup on Apache some Multiple Namebased Virtual Websites with cgi-bin FunkFlex Linux - Newbie 0 02-08-2002 08:37 AM
Apache SSL - how to virtual host two or more secure websites on the same machine? bjoshi Linux - Networking 0 08-30-2001 07:01 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:40 AM.

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