Domain entry order produces incorrect apache configuration

Bug #1166898 reported by Jason Brooks
8
This bug affects 1 person
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

Revision history for this message
ehcpdeveloper (ehcpdeveloper) wrote :

working on this now.

Revision history for this message
ehcpdeveloper (ehcpdeveloper) wrote :

First, thanks for bug report and excelent explanation. It made me understand fully and easily.
I agree with the problem.

Now, I tried to fix it in ehcp code, you may download the new testing version from ehcp.net/ehcp_yeni.tgz
first, backup your existing ehcp, upgrade your ehcp, then test.

after upgrade:
restart your ehcp: /etc/init.d/ehcp restart
logout & login back (this fixes a little about db)
choose the domain that should reside last,
click settings below, right of screen, (settings of domain, currently single item)
put a large value in "theorder" setting. (currently single item here)
click submit.

your that domain will reside last in config, if everything goes right.

Note that this is new testing version of 0.33, I tested this function only, now, I did not test other parts throughly,
please test and send here any problems if occurs.. I will try to fix them all asap, if any.

later, if you have much problem, you may fall back to older version.
Let us know the result ... and thanks for bug-report

Changed in ehcp:
importance: Undecided → Low
assignee: nobody → ehcpdeveloper (ehcpdeveloper)
status: New → Fix Committed
milestone: none → ehcp-0.33
Revision history for this message
Jason Brooks (jasonbbrooks) wrote : Re: [Bug 1166898] Re: Domain entry order produces incorrect apache configuration
Download full text (4.1 KiB)

Hello,

I will be happy to test this. Thanks for the work!

--jason

On Apr 12, 2013, at 4:22 AM, ehcpdeveloper wrote:

> First, thanks for bug report and excelent explanation. It made me understand fully and easily.
> I agree with the problem.
>
> Now, I tried to fix it in ehcp code, you may download the new testing version from ehcp.net/ehcp_yeni.tgz
> first, backup your existing ehcp, upgrade your ehcp, then test.
>
> after upgrade:
> restart your ehcp: /etc/init.d/ehcp restart
> logout & login back (this fixes a little about db)
> choose the domain that should reside last,
> click settings below, right of screen, (settings of domain, currently single item)
> put a large value in "theorder" setting. (currently single item here)
> click submit.
>
> your that domain will reside last in config, if everything goes right.
>
> Note that this is new testing version of 0.33, I tested this function only, now, I did not test other parts throughly,
> please test and send here any problems if occurs.. I will try to fix them all asap, if any.
>
> later, if you have much problem, you may fall back to older version.
> Let us know the result ... and thanks for bug-report
>
>
> ** Changed in: ehcp
> Importance: Undecided => Low
>
> ** Changed in: ehcp
> Assignee: (unassigned) => ehcpdeveloper (ehcpdeveloper)
>
> ** Changed in: ehcp
> Status: New => Fix Committed
>
> ** Changed in: ehcp
> Milestone: None => ehcp-0.33
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1166898
>
> Title:
> Domain entry order produces incorrect apache configuration
>
> Status in Easy Hosting Control Panel for Ubuntu:
> Fix Committed
>
> 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 ...

Read more...

Revision history for this message
Jason Brooks (jasonbbrooks) wrote :

Hello,

I apologize for how late I have been in replying to this thread.

I have just tested this in my test environment, and the "theorder" field does exactly what it appears to do.

If I had to add one additional thing, it would be to use theorder in the "selectdomains" op, seen from the "listdomains" link on the dashboard.

By the time I got to this, the version in classapp was 0.35.2.

--jason

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.