Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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>
share|improve this answer
    
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 '12 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 '12 at 12:01
    
Okay, thank you, I will take a look at this. –  SinisterMJ Sep 4 '12 at 12:02

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.