I know this is more of an Apache question, but I'm hoping someone on
this list with more experience in Pylons deployment can give me some
advice here.

I have a server running Debian 6.  I am serving multiple Pylons web
applications using Apache2 to reverse proxy different domain names to
different Pylons apps running on different ports.

The setup I currently have is partially successful.  I have a static
IP.  I also have a number of subdomains of my university department's
domain resolving to my IP address.  These subdomains are:

- mysubdomain.department.university.com
- abc.mysubdomain.department.university.com
- def.mysubdomain.department.university.com
- ...

The file /etc/apache2/sites-available/
mysubdomain.department.university.com successfully forks various
further subdomains to different Pylons apps.  For example,
abc.mysubdomain.department.university.com serves Pylons app 1,
def.mysubdomain.department.university.com serves Pylons app 2, etc.
The file /etc/apache2/sites-available/
mysubdomain.department.university.com looks something like the
following.

[code]
NameVirtualHost *

<VirtualHost *>
    ServerName abc.mysubdomain.department.university.com
    ServerAlias abc.mysubdomain.department.university.com

    ProxyPreserveHost On
    ProxyPass / http://localhost:8080/ retry=5
    ProxyPassReverse / http://localhost:8080/
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
</VirtualHost>

<VirtualHost *>
    ServerName def.mysubdomain.department.university.com
    ServerAlias def.mysubdomain.department.university.com

    ProxyPreserveHost On
    ProxyPass / http://localhost:8081/ retry=5
    ProxyPassReverse / http://localhost:8081/
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
</VirtualHost>
[/code]

Now, I also have a domain, mydomain.com, that resolves to my IP
address.  If I enter http://mydomain.com into my browser, I get the
default web app of my server.  However, I have not succeeded in using
the same approach as above to fork subdomains of my domain to various
Pylons apps.  That is, I can't even get www.mydomain.com to work.

I have a file /etc/apache2/sites-available/mydomain.com that looks
something like the following.

[code]
NameVirtualHost *

<VirtualHost *>
    ServerName mydomain.com
    ServerAlias www.mydomain.com

    # Proxy
    ProxyPass / http://localhost:8080/ retry=5
    ProxyPassReverse / http://localhost:8080/
    ProxyPreserveHost On
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
</VirtualHost>
[/code]

Then I enable these configuration files and restart Apache:

[code]
a2ensite mydomain.com
a2ensite abc.mysubdomain.department.university.com
sudo /etc/init.d/apache2 restart
[/code]

The result is that mydomain.com,
abc.mysubdomain.department.university.com and
def.mysubdomain.department.university.com all work as expected but
www.mydomain.com returns a "Server not found" error.

I ultimately want to have mydomain.com, www.mydomain.com and
mysubdomain.department.university.com to all point to the same app
(e.g., App #1).  Then I want abc.mysubdomain.department.university.com
and abc.mydomain.com to point to the same app (e.g., App #2).  Then I
want def.mysubdomain.department.university.com and def.mydomain.com to
point to the same app (e.g., App #3).  Etc.

Is this possible?

I had a hunch that I need to edit my /etc/hosts and/or my /etc/
resolv.conf files but the various changes I made there seemed to have
no effect.  (Btw, running "hostname -f" returns "X.Y" where X is my
hostname and Y is "mysubdomain.department.university.com".)

If I run

  host www.mydomain.com

I get

  Host www.mydomain.com not found: 3(NXDOMAIN)

But also, if I run

  dig www.mydomain.com

I see that mydomain.com is listed in the "AUTHORITY" section.

I appreciate any help.  Please let me know if more information is
needed.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to