2

I have a simple httpd.conf, which is working

<VirtualHost *>
    AddDefaultCharset UTF-8

    DocumentRoot "/opt/rt4/share/html"
    <Location />
        Order allow,deny
        Allow from all

        SetHandler modperl
        PerlResponseHandler Plack::Handler::Apache2
        PerlSetVar psgi_app /opt/rt4/sbin/rt-server
    </Location>
    <Perl>
        use Plack::Handler::Apache2;
        Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server");
    </Perl>
</VirtualHost>

When I connect to MyDomain.dynamicDNSServer.TLD, I load my RT just fine.

But since I want it to be rt.MyDomain.dynamicDNSServer.TLD, I set it to exactly the same thing, except I make it

<VirtualHost rt.MyDomain.dynamicDNSServer.TLD>

and now when I restart Apache2, it says "No address associated with hostname: Could not resolve host name rt.MyDomain.dynamicDNSServer.TLD -- ignoring!"

How would I do that? I cannot assign it a static IP in hosts, since it will change whenever my router grabs a new IP.

1 Answer 1

2

First of all, be sure that you have a specific subdomain dyndns entry or a wildcard dyndns entry for your ip. This means that besides MyDomain.dynamicDNSServer.TLD also either *.MyDomain.dynamicDNSServer.TLD or at least rt.MyDomain.dynamicDNSServer.TLD have to resolve to your dynamic ip. If you have neither of these you cannot use a subdomain-specific apache configuration.

In apache, subdomains are specified by ServerName and not using the <VirtualHost> directive (see docs for further information).

The following should work for your subdomain:

<VirtualHost *>
    ServerName rt.MyDomain.dynamicDNSServer.TLD
    AddDefaultCharset UTF-8
    DocumentRoot "/opt/rt4/share/html"
    ...
</VirtualHost>
2
  • Still does not work, it still behaves the same way. Cannot access it via rt.MyDomain.dynamicDNSServer.TLD. Even with the servername directive in there, I can still access it via MyDomain.dynamicDNSServer.TLD
    – SinisterMJ
    Sep 4, 2012 at 11:36
  • @AntonRoth You have to use a specific or wildcard dynamic dns entry (this has to be set up with your dyndns provider). Otherwise you can't use subdomain-specific apache configurations. I updated my answer accordingly.
    – speakr
    Sep 4, 2012 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .