Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been struggling with this, basically what I want is this:

A virtual domain to run on the 80 another virtual domain to run FROM 80 TO 8080

what I've done so far is trying different combinations with apache, but all i got is having all the virtual domains pointing to port 80 this is my conf:

<VirtualHost domain1.com:80>
DocumentRoot /var/www/domain1
<Directory "/var/www/domain1">
allow from all
Options +Indexes
</Directory>
ServerName domain1.com
</VirtualHost>

<VirtualHost server.domain2.com:80>
DocumentRoot /var/www
<Directory "/var/www">
allow from all
Options +Indexes
</Directory>

    ServerName server.domain2.com
    ServerAlias www.server.domain2.com
    ProxyPass / http://server.domain2.com:8080/

       </VirtualHost>

suggestions? :(

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Do domain1.com / server.domain2.com resolve on different addresses? If not you're aiming for NameVirtualHost Configuration:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName domain1.com
    ...
</VirtualHost>
<VirtualHost *:80>
    ServerName server.domain2.com
    ...        
    ProxyPass / http://server.domain2.com:8080/
    ProxyPassReverse / http://server.domain2.com:8080/
    ...
</VirtualHost>
share|improve this answer
    
thanks! adding NameVirtualHost *:80 Listen 80 did the trick –  Simone Nov 18 '12 at 15:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.