# [apache2] ProxyPreserveHost

## commandline

hi all,

i'm trying to use ProxyPreserveHost in one of my vhosts.

i already added "proxy" to make.conf APACHE2_MODULES but when i restart apache it says:

Invalid command 'ProxyPreserveHost', perhaps misspelled or defined by a module not included in the server configuration

is there something else i forgot to do?

thanks...

----------

## commandline

anyone please?

----------

## commandline

just a suggestion is welcome...

----------

## coRpTitan

Because of there is no logs/confs I will just try:

- Did you recompiled apache after adding make.conf ?

- When you execute: cat /etc/conf.d/apache2 | grep APACHE2_OPTS=  what do you see as output?

- When you execute apache2 -t what's the output?

- Can you please post your relevant part of logs/confs?

----------

## commandline

hi, thanks for the reply.

```

$ cat /etc/conf.d/apache2 | grep APACHE2_OPTS=

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5"

```

```

$ apache2 -t

Syntax OK

```

i only added this to my vhost.conf:

```

<VirtualHost *:80>

  ServerName subdomain.domain.tld

  ProxyPreserveHost On

  ProxyPass / http://<lan_ip>:<port>

  ProxyPassReverse / http://<lan_ip>:<port>

</VirtualHost>

```

----------

## coRpTitan

 *commandline wrote:*   

> hi, thanks for the reply.
> 
> ```
> 
> $ cat /etc/conf.d/apache2 | grep APACHE2_OPTS=
> ...

 

I think that's your problem, try to add -D PROXY . Most modules needs to be started/loaded by this way, see bottom of this file for list of modules.

----------

## commandline

perfect!

thanks a lot.

----------

