ServerAlias

Watje6

Verified User
Joined
Feb 12, 2004
Messages
24
Location
The Hague, Netherlands
I have a little problem with ServerAlias. I will put as much info here that I have, so I hope you can help me the best way ;)

I have a domain watjes.info and I use 2 subdomains.

1st VirtualHost is www.watjes.info
2nd VirtualHost is je.naam.watjes.info
3rd VirtualHost watje6.watjes.info

The thing that I want is to get a ServerAlias *.watjes.info at the 2nd VirtualHost (je.naam.watjes.info).

When I open Customize Httpd Configurations (as admin) I can only add a line at the 1st VirtualHost.

So my first problem is that I can't add a custom ServerAlias at the 2nd Virtual Host.

Posslible solution would be to manualy edit the httpd.conf by ssh.
Well I did that, the 3rd VirtualHost didn't work because of the ServerAlias *.watjes.info at the 2nd VirtualHost. (apache doesn't see the ServerAlias watje6.watjes.info because the ServerAlias *.watjes.info is higher in the httpd.conf).

So I manualy edit it to this:
1st VirtualHost is www.watjes.info
2nd VirtualHost watje6.watjes.info
3rd VirtualHost is je.naam.watjes.info (with ServerAlias *.watjes.info)

The next day DA rewritten the httpd.conf to the original situation so it doesn't work anymore :(

I Hope someone can help me
 
Hello,

I don't think the custom httpd.conf feature will work for your situtation. I think it would be easiest to just manually add whatever you need to the main /etc/httpd/conf/httpd.conf file, and just make sure you place it before the "Include" line for your user httpd.conf. Then apache will default to that one instead (you could even just comment the Include line out by adding a # in front)

John
 
Now part 2,

when someone goes to an unused subdomain like ftp.domain.com they see the shared IP message.

-

when a domain is added, te 1st VistualHost is www.domain.com and ServerAlias domain.com and to lose the shared IP message we need a ServerAlias *.domain.com
I guess that´s no prob to add in some config file.

The problem we then get is when the user adds subdomains, because the VirtualHosts off the subdomains will be added below the www.domain.com VirtualHost.

Is it possible in the next version off DA to keep the www.domain.com VirtualHost at the bottom off the httpd.conf and add the ServerAlias *.domain.com to that VirualHost.

When the users adds an subdomain that VirtualHost has to be added at the top of the httpd.conf
 
Hello,

Just edit the virtual host templates. They should give you all the flexibility you want :)

cd /usr/local/directadmin/data/templates
cp virtual_host*.conf custom
cd custom
# edit all custom virtualhost templates as need

(the ones in the custom folder have priority)

John
 
Hello,

The virtualhost order is hard coded. Apache doesn't look for real servernames before looking through the wildcards?.. hmm.

John
 
Hello,

No, it's hard coded. I can consider moving subdomains first, but the only issue would be that owned IP domains wouldn't see their main domain when they visit the IP without a domain provided.. instead they'd see a subdomain. That would need to be figured out first.

John
 
Maybe i´t an idea to add an Serveralias with the IP to the VirtualHost of www.domain.com when the users owns the IP ?

When does apache use the sharedip folder when you type in the IP ? is it possible that the IPowner gets a sharedip folder for unused subdomains instead of seeing a subdomain website?
 
but in that case there are no subdomains right ?
And when you add an virtualhost with the main ip under the subdomains it should work am I right ?

Cedric
 
Back
Top