Domain entry order produces incorrect apache configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Easy Hosting Control Panel for Ubuntu |
Fix Committed
|
Low
|
ehcpdeveloper |
Bug Description
Hello,
This is ehcp version 0.30.9 running under ubuntu 11.10
Here is the short version of my bug report:
ehcp produces the apachehcp.conf file out of its database in the order the domains were setup. Ehcp needs to figure out parent and child domain relationships and build the apachehcp.conf file in the correct order. This probably applies to the other apachehcp.* files also.
Here is my explanation:
My site runs a parent domain and several subdomains as separate sites. Making these sub-sites into subdomains of the parent site is not an option: each site is a separate paying customer.
For instance the following domains are present (in the order they were entered, and the order they appear)
test.xxxx.com
customer1.xxxx.com
customer2.xxxx.com
xxxx.com
mu.xxxx.com
Now, this produces the (shortened by me) apachehcp.conf file:
<virtualhost *>
servername test.xxxx.com
</virtualhost>
<virtualhost *>
servername customer1.xxxx.com
</virtualhost>
<virtualhost *>
servername customer2.xxxx.com
</virtualhost>
<virtualhost *>
servername xxxx.com
</virtualhost>
<virtualhost *>
servername mu.xxxx.com
</virtualhost>
This results in the following behaviour: surfing to test.xxxx.com, customer1.xxxx.com, customer2.xxxx.com, and xxxx.com produce the correct sites, and their custom logs reflect this.
However, surfing to "mu.xxxx.com" goes to the xxxx.com site. the customlog entries for xxxx.com show the accesses, and the original host request as "mu.xxxx.com". There are no .htaccess.
Apache serves virtual hosts in the order they are defined, and will deliver the browser request for mu.xxxx.com to xxxx.com. Apache is not aware of parent and child domains. In order to test this, I edited this apache configuration file and moved the xxxx.com section to the very end, and reloaded apache. the mu.xxxx.com site worked correctly.
A work-around could be to be able to alter the order that domains appear in the database. However, I do not know how the database is structured enough to make modifications though.
Thank you for your time...
--jason brooks
working on this now.