General advice on a new setup

General advice on a new setup

As i’m using DA for several years now i’ve had my share of issues with hardware failure, configuration errors and more…
The plan arrived to create a virtual server environment so that I could create a test server to compile stuff on in development and later do the same on the production so that I would have less downtime etc.

I got an offer from a friend to get a decent server ready for virtualisation and for a decent price so i’m currently setting the server up the way I want to.

Here is a picture of the setup I already created, and am on my way of finalizing this…
Attachment 1430

As you can see i have an external and an internal network interface on the directadmin box. public for all traffic that needs to be direct, and private for all the traffic that could pass by the virtual network.

Now my problem is the folowing:
all users get assigned ip2 as en example. This is the ip of the directadmin box and default for everyone. They will use a mailfilter appliance to get their mail filtered, and have to use the database that is on a different server on the private network.
But I also want to provide USER_X with a varnish caching server so their site can benefit of the speed of a caching server and maybe even other options.

My old server had all this features too, but constructed on one physical server.
For example the old server had this setup:
X.X.X.X –> port 80 –> default apache X.X.X.X:80
Y.Y.Y.Y –> port 80 –> varnish –> default apache Y.Y.Y.Y:8080

DNS –> –> X.X.X.X –> default apache
DNS –> –> Y.Y.Y.Y –> varnish –> Y.Y.Y.Y:8080

What i would want now is this:

DNS –> ip1 –> varnish –> apache (directadmin internal interface)
DNS –> ip2 –> apache IP 2:80 (directadmin external interface)

for the trick to rewrite the user httpd.conf with the correct values i used a custom template "virtual_host2.conf" "virtual_host2_sub.conf" to do the folowing:


|*if IP="Y.Y.Y.Y"|
<VirtualHost |IP|:8080 |MULTI_IP|>
<VirtualHost |IP|:80 |MULTI_IP|>

This way users could modify their subdomains and domains themselves without problem. If they had been assigned the Y.Y.Y.Y ip the apache would listen on port 8080 and otherwise it would listen on port 80.

Varnish is configured to listen on Y.Y.Y.Y:80 and forwards the request to Y.Y.Y.Y:8080. Apache sees that is being requested and serves the correct home dir as configured…

Can anyone shed some light on my new situation and how to handle this properly (as you might have guessed i’m not doing things by default 😉 )


As some of you might not know what exactly the issue is:
Directadmin listens on IP2 and creates it httpd.conf to listen on IP2:80
I want him to listen on the private address as well ( (without modifying the ip in the DNS zone ofc)

Update end

With kind regards,


Attached Images
Comments are closed.