<VirtualHost IP:port>

Hello,

We can not set the IP of virtual server pools using server template :

VirtualMin does automatically find the IP, but for persons which tries to use reverse proxy for server, the IP should be *:80 or 127.0.0.1:80

I am currently modify source to do this : sed -i /usr/libexec/webmin/virtual-server/feature-web.pl -e 's/$vip:$port/*:$port/g'

Also, some other features to set : - Do not automatically add "NameVirtualHost" on httpd.conf - Do not automatically modify "Listen" on httpd.conf - Do not automatically modify "Port" on httpd.conf

Status: 
Active

Comments

So is the issue that the IP in the <VirtualHost> block is wrong?

Webmin will put an ip:port in there if you have a NameVirtualHost directive in your Apache config for that IP. Otherwise, it will use * .

Mostafa's picture
Submitted by Mostafa on Tue, 11/09/2010 - 23:20

I am using squid+apache2, squid is running on server-ip:80, and apache on 127.0.0.1:80

As I know we need NameVirtualHost *:80 or NameVirtualHost 127.0.0.1:80 <VirtualHost *:80> <VirtualHost 127.0.0.1:80> for virtualservers, but we can not set them in server template of virtualmin. VirtualMin automatically add NameVirtualHost IP:80 if can not find any NameVirtualHost directive.

Ok, so it sounds like what you want is for the IP of your domains to be 127.0.0.1 for the Apache config, but the external IP for the DNS records?

If so, this can be setup at System Settings -> Virtualmin Configuration -> Networking settings. You should set "Default virtual server IP address" to 127.0.0.1 , and "Default IP address for DNS records" to your real external IP.

Mostafa's picture
Submitted by Mostafa on Thu, 11/11/2010 - 00:44

Default virtual server IP address = *

1- The * use correctly for : <VirtualHost *:80> But it binds apache to *:80 too which prevent squid to start, I tried to disable this by :

sed -i /usr/share/webmin/virtual-server/feature-web.pl -e 's/@listen > 0/@listen < 0/g'

Please add this feature to disable adding "Listen " directive.

2- The IP for DNS records is * too which is incorrect. This occurs even we use : Default IP address for DNS records = Automatically detect external address

Adding this feature will solve the problem : Default IP address for DNS records = From network interface

You don't want to enter * there .. instead enter 127.0.0.1 , which will make Virtualmin put 127.0.0.1 into the <Virtualhost> block. After doing this, you should manually edit httpd.conf and change any existing virtualhosts to also use 127.0.0.1 as the IP, and any Listen or NameVirtualHost directives to 127.0.0.1 .

Mostafa's picture
Submitted by Mostafa on Thu, 11/11/2010 - 01:27

It works good for 127.0.0.1 only. 127.0.0.1 is used for local reverse proxy, VirtualHost *:80 is needed too.

1- The * use correctly for : But it binds apache to *:80 too which prevent squid to start, I tried to disable this by :

sed -i /usr/share/webmin/virtual-server/feature-web.pl -e 's/@listen > 0/@listen < 0/g'

*** Please add this feature to disable adding "Listen " directive. ***

2- The IP for DNS records is * too which is incorrect. This occurs even we use : Default IP address for DNS records = Automatically detect external address

Adding this feature will solve the problem : Default IP address for DNS records = From network interface

I'm not sure if it is possible to have virtualmin support this setup with a reverse proxy, sorry ... it was designed to support having Apache take requests directly on the real IP.

Are you sure you want to use a reverse proxy?