Forum Moderators: phranque
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]
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.
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]
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]
<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]
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]