Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
one apache server, two web sites
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jeezus84
Apprentice
Apprentice


Joined: 02 Jan 2005
Posts: 161
Location: Canadia

PostPosted: Wed May 10, 2006 1:56 pm    Post subject: one apache server, two web sites Reply with quote

Evening everyone,

In short, I want to host two different websites on one server. I want one site to load for port, say, 6969, and a different site to load for port, say, 666. I was perusing the forums and found people speaking of virtual hosts and such but I really have no idea how they work or if this is even the solution for me.

The reason I ask is because I have two domains through noip.com. Each IP will forward to a different port on the server machine. I'm looking to use one domain name for a test copy of the website, and the other for the actual working website.

So, any suggestions would be greatly appreciated.

Thanks,

Ian
Back to top
View user's profile Send private message
bkunlimited
l33t
l33t


Joined: 18 Jun 2004
Posts: 672

PostPosted: Wed May 10, 2006 2:06 pm    Post subject: Reply with quote

I think this can be done with mod_rewrite.

e.g. if you want to redirect requests coming in to port 80 to port 8080 you can do it by the following entry in your apache configuration:

Code:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^/(.*) \
    http://localhost:8080/blablabla$1 [L,P]
</IfModule>


You just have to check out if it also works vice versa
Back to top
View user's profile Send private message
jeezus84
Apprentice
Apprentice


Joined: 02 Jan 2005
Posts: 161
Location: Canadia

PostPosted: Wed May 10, 2006 2:24 pm    Post subject: Reply with quote

I'm not quite sure this is what I need either.

Basically I want requests on port 6969 to use, say, '/mnt/myDrive/website1' as the DocumentRoot and requests on port 666 to use, say, '/mnt/myDrive/website2' as the DocumentRoot.
Back to top
View user's profile Send private message
nevynxxx
Veteran
Veteran


Joined: 12 Nov 2003
Posts: 1123
Location: Manchester - UK

PostPosted: Wed May 10, 2006 2:27 pm    Post subject: Reply with quote

Why the differnet ports?

Why not just read the docs, (Gentoo and Apache) and set up vhosts.

That way you just have different names for the same server for the different websites, and don't have to worry about port numbers.
_________________
My Public Key

Wanted: Instructor in the art of Bowyery
Back to top
View user's profile Send private message
jeezus84
Apprentice
Apprentice


Joined: 02 Jan 2005
Posts: 161
Location: Canadia

PostPosted: Wed May 10, 2006 2:33 pm    Post subject: Reply with quote

my reasoning for the different ports is because I use dynamic DNS with noIP for my sites.

so basically, when someone surfs to 'http://www.domain1.com' noIP is really sending them to 'http://123.456.789:6969/', and 'http://www.domain2.com' sends the user to 'http://123.456.789:666'.
Back to top
View user's profile Send private message
jeezus84
Apprentice
Apprentice


Joined: 02 Jan 2005
Posts: 161
Location: Canadia

PostPosted: Wed May 10, 2006 3:09 pm    Post subject: Reply with quote

okay, using vhosts worked. thanks for the tip.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum