Forum Moderators: phranque

Message Too Old, No Replies

Multi Domain Server

         

aero97one

10:24 pm on Feb 23, 2008 (gmt 0)

10+ Year Member



Hi i'm have been trying to do this for some time, i have 4 sites that are operating of of one server computer, each site is on a different port

example1 - 80
example2 - 81
example3 - 82
example4 - 83

i have all my domains directed to the servers ip, but how do i make it so that the server knows which port to show based on the domain, i've been racking my brain trying to get this figured out. anyone that can help i would really appreciate it. thanks alot

brad trammell

[edited by: phranque at 2:34 am (utc) on Feb. 25, 2008]
[edit reason] removed specifics [/edit]

webdoctor

9:43 am on Feb 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you tell us what software you're using (e.g. IIS6 / Apache2 / ...)?

Are you aware of the Host Header technique? It lets you run several sites on the same port.

How will your visitors know to enter the port number as well as the domain name in their browser? [webmasterworld.com:81...] isn't exactly standard - and some proxies/firewalls are configured to block http access to non-standard ports.

aero97one

2:43 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



i am using WAMP Sever (Apache 2.2.6, PHP5)

i don't want them on the same port. i want them operated on seperate ports because the sites are in no way affiliated.

i want to make it so that if you were to go to www.example3.com, it would automatically know to look at port 82 on the server. or example2.com it would look at port 81.

i don't want the redirection to be in a frame, i want it to show up as if in the root of the server, if that makes sense.

[edited by: phranque at 2:36 am (utc) on Feb. 25, 2008]
[edit reason] examplified [/edit]

aero97one

2:44 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



does that header technique do that?

webdoctor

7:00 pm on Feb 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i don't want them on the same port. i want them operated on seperate ports because the sites are in no way affiliated.

Two comments on this:

1. Big ISPs run many thousands of customers' sites on the same server - and their customers aren't affiliated.

2. Your sites are all on the same IP address, even if the sites run on different ports, anyone trying to determine associations between your sites is going to find out very quickly using the ip address.

i want to make it so that if you were to go to www.example3.com, it would automatically know to look at port 82 on the server

Essentially you can't do this. If a user types www.example.com in their browser the browser goes to port 80 to look for the site. Only if the user types www.example.com:81 will the browser go to port 81 to look for the site. The only way round this would be to run a site on port 80 using host headers to detect which site is being requested and then issue a 30x redirect from this site to the right port - but if you're going to use host headers to detect which site the user requested, why not just serve the site's content while you're at it?

From where I'm standing you are trying to reinvent the wheel - there is a tried and tested technology out there for running many sites on one server on the standard http port - please have a long hard think about it!

[edited by: phranque at 2:37 am (utc) on Feb. 25, 2008]
[edit reason] examplified [/edit]

aero97one

7:10 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



how do i add this host header?

aero97one

7:24 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



well ok i have added it but it tells me that the webpage declined to show me the index page, it's a 403 error, here is what i have:

<VirtualHost *:80>
DocumentRoot D://example2
ServerName www.example2.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot D://example3
ServerName www.example3.com
</VirtualHost>

let me know if this is wrong.

[edited by: phranque at 2:39 am (utc) on Feb. 25, 2008]
[edit reason] examplified [/edit]

aero97one

7:34 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



both document root folders are in the root of the d drive and are called example2 & example3.

[edited by: phranque at 2:40 am (utc) on Feb. 25, 2008]
[edit reason] removed specifics [/edit]

aero97one

9:29 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



nvm i got it thanks for your help

aero97one

9:33 pm on Feb 24, 2008 (gmt 0)

10+ Year Member



nvm it was redirecting all the domains to one folder

aero97one

3:09 am on Feb 25, 2008 (gmt 0)

10+ Year Member



this host header thing is still not working whatsoever. I've tried it like 30 different ways. I don't know what I am doing wrong.

All the domains are pointed to: 24.58.39.X

and this is the code i added to my http.conf file:

<VirtualHost www.example1.com:80>
DocumentRoot d:/wamp/www
ServerName www.example1.com
ServerAlias www.example1.com
ErrorLog D:/example1_error_log.txt
CustomLog D:/example1_access_log.txt common
php_value error_log "D:/example1/php_error_log.txt"
<Directory "d:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost www.example2.com:80>
DocumentRoot d:/example2
ServerName www.example2.com
ServerAlias www.example2.com
ErrorLog D:/example2/error_log.txt
CustomLog D:/example2/access_log.txt common
php_value error_log "D:/example2/php_error_log.txt"
<Directory "d:/example2">
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost www.example3.com:80>
DocumentRoot d:/example3
ServerName www.example3.com
ServerAlias www.example3.com
ErrorLog D:/example3/error_log.txt
CustomLog D:/example3/access_log.txt common
php_value error_log "D:/example3/php_error_log.txt"
<Directory "d:/example3">
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

and as far as i can see it's correct, but it still doesn't work.

[edited by: phranque at 3:28 am (utc) on Feb. 25, 2008]
[edit reason] removed specifics [/edit]