View previous topic :: View next topic |
Author |
Message |
jeezus84 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/73833917042555c9712830.gif)
Joined: 02 Jan 2005 Posts: 161 Location: Canadia
|
Posted: Wed May 10, 2006 1:56 pm Post subject: one apache server, two web sites |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
bkunlimited l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 18 Jun 2004 Posts: 672
|
Posted: Wed May 10, 2006 2:06 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
jeezus84 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/73833917042555c9712830.gif)
Joined: 02 Jan 2005 Posts: 161 Location: Canadia
|
Posted: Wed May 10, 2006 2:24 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
nevynxxx Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 12 Nov 2003 Posts: 1123 Location: Manchester - UK
|
Posted: Wed May 10, 2006 2:27 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
jeezus84 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/73833917042555c9712830.gif)
Joined: 02 Jan 2005 Posts: 161 Location: Canadia
|
Posted: Wed May 10, 2006 2:33 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
jeezus84 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/73833917042555c9712830.gif)
Joined: 02 Jan 2005 Posts: 161 Location: Canadia
|
Posted: Wed May 10, 2006 3:09 pm Post subject: |
|
|
okay, using vhosts worked. thanks for the tip. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|