Is proxy default enabled with CB2?

bjorn

Verified User
Joined
Sep 17, 2014
Messages
17
Hi,

I have a VPS with DA+CB2 running on CentOS.

A few days ago I enabled a CDN (cloudfare) for my main domain. Cloudfare doesn't proxy the port 2222.. So i can't access DA with this CDN enabled.
I looked at this DA HowTo and added the VHOST changes only for the domain that has the CDN enabled:
Code:
   ServerName cp.|DOMAIN|
   ProxyRequests Off
   ProxyPass / http://127.0.0.1:2222/
   ProxyPassReverse / http://127.0.0.1:2222/

It immediatly worked.

I don't want to add these VHOST changes over the complete server. So no need to edit the virtual_host2.conf.
But i did expect to enable proxy and recompile apache? Is it default enabled with CB2?

If no, how is it possible this works only with the above vhost changes?

Regards,
Bjorn
 
Oops sorry, I opened this tread to fast, it appears the main domain and all subdomains is pointing to the DA login now :p..

So i'm going to enable the proxy now.
 
hmmm, i followed the DA howto and it doesn't work :(.

I did the following:

1. check if proxy is enabled.
I checked the /usr/local/directadmin/custombuild/configure/ap2/configure.apache file and it already has the '--enable-proxy' entry, so no need to recompile apache and php (wright??)..

2. I already have the vhost2 in the custom dir for webmail.domain, so i added this to the custom vhost:
Code:
<VirtualHost |IP|:80>
   ServerName cp.|DOMAIN|
   ProxyRequests Off
   ProxyPass / http://127.0.0.1:2222/
   ProxyPassReverse / http://127.0.0.1:2222/
</VirtualHost>

3. Rewrite httpd.conf
Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

4. add a cp A record for all your domains in: /usr/local/directadmin/data/templates/custom/dns_a.conf
Code:
echo "cp=|IP|" >> dns_a.conf

5. shut off the 'Referer Header Check' for DA. which is explained here

I also did:
Code:
./build clean
./build apache

---------------------------

It is working now but not really how i want, for the main domain i have a htaccess rewrite rule non www. to www.
This is conflicting with the new cp.mydomain.com.

Now, when i go to cp.mydomain.com it resolves into: www.cp.mydomain.com/cp/ and this is not working.
When i remove the www. so the url is 'cp.mydomain.com/cp/' it works!

How do i add a Vhost non-www. to www. entry for all domains that is not conflicting with the proxypass cp?

Regards,
Bjorn
 
I added the following to the custom vhost2 file:
Code:
<VirtualHost |IP|:|PORT_80| |MULTI_IP| >
	ServerName |DOMAIN|
	Redirect permanent / http://www.|DOMAIN|
</VirtualHost>

And removed all the non www. redirect rules in htaccess files.

The non-www. redirect is working perfectly.

After clearing the firefox cache (aaargh) the cp.mydomain.com is working now for all domains.. I notice only 1 thing, after DA login, it adds a second / to the url like this: 'cp.mydomain.com//'
DA will work like that, but it's not nice, is there a solution for this?

Regards,
Bjorn
 
Back
Top