Forum Moderators: phranque

Message Too Old, No Replies

2 websites, 1 server

help with apache conf and dns

         

matt31084

8:08 am on Jul 10, 2005 (gmt 0)

10+ Year Member



ok I'm hosting 2 websites on 1 server that blocks port 80. here's the vhost section of my conf file:

<VirtualHost my.ip>
ServerAdmin webmaster@website1.com
DocumentRoot "G:/website1"
ServerName www.website1.com
ServerAlias *.website1.com
Redirect / [website1.com:8080...]
ErrorLog logs/www.website1.com-error_log
CustomLog logs/www.website1.comt-access_log common
</VirtualHost>

<VirtualHost my.ip>
ServerAdmin webmaster@website2.com
DocumentRoot "G:/website2"
ServerName website2.com
ServerAlias *.website2.com
Redirect / [website2.com:8080...]
ErrorLog logs/website2-error.log
ScriptAlias /cgi-bin/ "G:/website2/cgi-bin/"
<Directory "G:/website2">
Options All Includes Indexes
</Directory>
</VirtualHost>

So I want to use port 8080 for both sites if possible. Will the redirect work or do I have to specify something in my DNS about port 8080 and if so can I use a CNAME for that or something?

matt31084

9:21 am on Jul 10, 2005 (gmt 0)

10+ Year Member



I currently have www.website1.com and www.website2.com pointed to my.ip

jdMorgan

8:51 pm on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a partial answer, since I can't answer all of your questions.

You'll have to tell Apache to listen on port 8080 -- See the Listen directive.

You're apparently using an unconditional redirect to port 8080. That will put the client browser into a loop. I'd suggest you use mod_rewrite to redirect to port 8080 only if the request is to port 80, or alternatively, to any port other than 8080.

Jim