You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Néstor Boscán <ne...@tcs.com.ve> on 2007/09/17 19:29:41 UTC

[users@httpd] NameVirtualHost question

Hi
 
I have a server that has an Apache Server 1.3. The server only has 1 IP and
can be access using two differente names server1 and server2. I would like
to create a VirtualHost for each name that sets the ServerName. Now I tried
the following
 
NameVirtualHost ip:80
 
<VirtualHost server1:80>
ServerName server1
...
</VirtualHost>
 
<VirtualHost server2:80>
ServerName server2
...
</VirtualHost>
 
And it doesn't work. It will not use the VirtualHosts. I also tried this:
 
 
NameVirtualHost ip:80
 
<VirtualHost ip:80>
ServerName server1
...
</VirtualHost>
 
<VirtualHost ip:80>
ServerName server2
...
</VirtualHost>
 
And again it doesn't work.
 
What is the correct configuration?

Re: [users@httpd] NameVirtualHost question

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 17.09.07 13:29, Néstor Boscán wrote:
> I have a server that has an Apache Server 1.3. The server only has 1 IP and
> can be access using two differente names server1 and server2. I would like
> to create a VirtualHost for each name that sets the ServerName. Now I tried
> the following
>  
> NameVirtualHost ip:80
> <VirtualHost server1:80>
> <VirtualHost server2:80>

NameVirtualHost and VirtualHost should have the same argument.

> And it doesn't work. It will not use the VirtualHosts. I also tried this:

> NameVirtualHost ip:80

> <VirtualHost ip:80>
> ServerName server1

> <VirtualHost ip:80>
> ServerName server2

> And again it doesn't work.

this should work, unless there's configuration error elsewhere.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
10 GOTO 10 : REM (C) Bill Gates 1998, All Rights Reserved!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache waiting for i/o -> optimizing

Posted by Joshua Slive <jo...@slive.ca>.
On 9/19/07, Bj <bj...@gmail.com> wrote:
> Stop logging !
> of maybe filter what you're logging (static ressources,...)
>
> For exemple, this will prevent logging ressource
> calls begining with /javascript/ urls :
> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
> combined
> SetEnvIf Request_URI "^/javascript/.*$" jscript
> CustomLog logs/access_log combined env=!jscript
>
> You can try memory caching, if somes sites are more requested than
> others, it might help. Or cache only some urls.

Memory caching isn't likely to help, since it will just deprive the OS
of buffer-cache resources that it could be using to help with IO
performance. In fact, anything you can do to reduce memory consumption
will likely help to some degree with the IO problems.

Cutting down on the logging could help. Enabling BufferedLogs might help too.

There are also various suggestions detailed here:
http://httpd.apache.org/docs/2.2/misc/perf-tuning.html

Plus there are various OS-specific ticks, like mounting your
filesystem with noatime specified. We know nothing about your OS, so
we can't help much here.

But these are really only going to help at the margin. If you are
simply working with a very busy server that has a working-set of files
too big to fit in the buffer caches, then nothing is going to help
other than providing better disk performance. You can do this by
spreading the load among multiple disks, either in the same server, or
in multiple load-balanced servers.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] mod_rewrite, query_string, is replacing & with &, it's a problem

Posted by Jonathan Rochkind <ro...@jhu.edu>.
So I am trying to use mod_rewrite to rewrite something in my query 
string.  Apache 2.2.3.

It appears that mod_rewrite or something else will rewrite all "&" in 
query string to "&amp;", whenever you do anything with the query string 
in mod_rewrite. Even with the [NE] flag. I'm not sure why it's doing 
this, and it's highly undesirable to me here, because the request ends 
up going to some software that is unhappy with the query string 
parameter delimiters being turned into "&amp;".

As an example, let's pretend I want to change 'dog' in the query string 
to 'cat'. I try:

RewriteEngine on
RewriteCond  %{query_string} ^(.*)dog(.*)$
RewriteRule   ^(.*)$   $1?%1cat%2  [NE,R,L]

Let's say the incoming URL is:

/foo?animal=dog&color=blue

What I get out of this is:

/foo?animal=cat&amp;color=blue

So 'dog' has been turned to 'cat' in the query string, good. But all of 
the "&" have also been turned to "&amp;". This is a problem for me in my 
particular circumstances. I want apache to leave the query string alone 
except for what I specifically replace.

Is this a bug? Is this intended behavior?  Is there anything I can do 
about this?

Advice appreciated.

Jonathan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache waiting for i/o -> optimizing

Posted by Samuel Vogel <sa...@gmx.de>.
Yeah, I wanted to switch to MySQL based logs for some time now.
Right now, I could disable the access log completly, but I don't see a 
single CustomLog directive in my config files?
Where could it be defined, or how could I disable it anyways? I'm 
running Debian.

h1314632:~# grep CustomLog /etc/apache2/*
/etc/apache2/apache2.conf:# a CustomLog directive (see below).
h1314632:~# grep CustomLog /etc/apache2/*/*
h1314632:~#

Regards,
Samy

Bj schrieb:
> Stop logging !
> of maybe filter what you're logging (static ressources,...)
>
> For exemple, this will prevent logging ressource calls begining with 
> /javascript/ urls :
> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" 
> \"%{User-Agent}i\"" combined
> SetEnvIf Request_URI "^/javascript/.*$" jscript
> CustomLog logs/access_log combined env=!jscript
>
> You can try memory caching, if somes sites 
> are more requested than others, it might help. Or cache only some urls.
>
> Check if you don't have a database or cgi/php code that make lots of i/o.
>
> -- 
> Bj
>
>
>
>
> On 9/18/07, *Samuel Vogel* < samy-delux@gmx.de 
> <ma...@gmx.de>> wrote:
>
>     Hey,
>
>     The delivery of my sites is getting somewhat sluggish, so I
>     checked top
>     and it say that 30% of my CPU time is just waiting for i/o.
>     Is there anything that I can do about this, as in optimizing Apache?
>     I'm thinking about caching mechnisms, but I have now over 6.000 sites
>     running, so I'm not expecting caching to be useful. Am I wrong on
>     this?
>
>     Since getting an addional server is not possible right now, is
>     there any
>     way to ease the situation?
>
>     Regards,
>     Samy
>
>     ---------------------------------------------------------------------
>     The official User-To-User support forum of the Apache HTTP Server
>     Project.
>     See <URL: http://httpd.apache.org/userslist.html> for more info.
>     To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>     <ma...@httpd.apache.org>
>        "   from the digest: users-digest-unsubscribe@httpd.apache.org
>     <ma...@httpd.apache.org>
>     For additional commands, e-mail: users-help@httpd.apache.org
>     <ma...@httpd.apache.org>
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache waiting for i/o -> optimizing

Posted by Bj <bj...@gmail.com>.
Stop logging !
of maybe filter what you're logging (static ressources,...)

For exemple, this will prevent logging ressource calls begining with
/javascript/ urls :
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
SetEnvIf Request_URI "^/javascript/.*$" jscript
CustomLog logs/access_log combined env=!jscript

You can try memory caching, if somes sites
are more requested than others, it might help. Or cache only some urls.

Check if you don't have a database or cgi/php code that make lots of i/o.

-- 
Bj




On 9/18/07, Samuel Vogel <sa...@gmx.de> wrote:
>
> Hey,
>
> The delivery of my sites is getting somewhat sluggish, so I checked top
> and it say that 30% of my CPU time is just waiting for i/o.
> Is there anything that I can do about this, as in optimizing Apache?
> I'm thinking about caching mechnisms, but I have now over 6.000 sites
> running, so I'm not expecting caching to be useful. Am I wrong on this?
>
> Since getting an addional server is not possible right now, is there any
> way to ease the situation?
>
> Regards,
> Samy
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

[users@httpd] Apache waiting for i/o -> optimizing

Posted by Samuel Vogel <sa...@gmx.de>.
Hey,

The delivery of my sites is getting somewhat sluggish, so I checked top 
and it say that 30% of my CPU time is just waiting for i/o.
Is there anything that I can do about this, as in optimizing Apache?
I'm thinking about caching mechnisms, but I have now over 6.000 sites 
running, so I'm not expecting caching to be useful. Am I wrong on this?

Since getting an addional server is not possible right now, is there any 
way to ease the situation?

Regards,
Samy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] NameVirtualHost question

Posted by Néstor Boscán <ne...@tcs.com.ve>.
The ones that comes with OracleAS 10.1.3

Regards,

Néstor Boscán 

-----Mensaje original-----
De: jslive@gmail.com [mailto:jslive@gmail.com] En nombre de Joshua Slive
Enviado el: Lunes, 17 de Septiembre de 2007 03:20 p.m.
Para: users@httpd.apache.org
Asunto: Re: [users@httpd] NameVirtualHost question

On 9/17/07, Néstor Boscán <ne...@tcs.com.ve> wrote:
> Hi
>
> Thanks for the quick answer.
>
> But it didn't work. Tried that one and:
>
> NameVirtualHost *:80
>

The one with *:80 in NameVirtualHost AND <VirtualHost> is the right
configuration. Don't screw with anything else.

The most common cause for requests not mapping to the proper vhost (other
than misconfiguration) is faulty third-party modules. What modules are you
using?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] NameVirtualHost question

Posted by Joshua Slive <jo...@slive.ca>.
On 9/17/07, Néstor Boscán <ne...@tcs.com.ve> wrote:
> Hi
>
> Thanks for the quick answer.
>
> But it didn't work. Tried that one and:
>
> NameVirtualHost *:80
>

The one with *:80 in NameVirtualHost AND <VirtualHost> is the right
configuration. Don't screw with anything else.

The most common cause for requests not mapping to the proper vhost
(other than misconfiguration) is faulty third-party modules. What
modules are you using?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] NameVirtualHost question

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Hi

Ok

<VirtualHost server1:80>
ServerName server1

ProxyRequests off
ProxyPass /proyects/bm/ http://someotherserver/BMSAHWeb/
ProxyPassReverse /proyects/bm/ http://someotherserver/BMSAHWeb/
</VirtualHost>

<VirtualHost server2:80>
ServerName server2

ProxyRequests off
ProxyPass /exchange http://someotherserver/exchange
ProxyPassReverse /exchange http://someotherserver/exchange
ProxyPass /exchweb http://someotherserver/exchweb
ProxyPassReverse /exchweb http://someotherserver/exchweb
</VirtualHost>

Regards,

Néstor Boscán
-----Mensaje original-----
De: Phillip Hamilton [mailto:phillip@myarchive.biz] 
Enviado el: Lunes, 17 de Septiembre de 2007 03:07 p.m.
Para: users@httpd.apache.org
Asunto: RE: [users@httpd] NameVirtualHost question

WE need you to fill in the info here:

<VirtualHost server1:80>
  ServerName server1
  ... <======HERE
</VirtualHost>

<VirtualHost server2:80>
  ServerName server2
  ... <======HERE
</VirtualHost>

-----Original Message-----
From: Néstor Boscán [mailto:nestor.boscan@tcs.com.ve]
Sent: Monday, September 17, 2007 2:00 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] NameVirtualHost question

Hi

Thanks for the quick answer.

But it didn't work. Tried that one and:

NameVirtualHost *:80

<VirtualHost server1:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost server2:80>
  ServerName server2
  ...
</VirtualHost>

And when I access the server using "server2" it doesn't take the VirtualHost
configuration. I have a ProxyPass inside VirtualHost for server2 and it
doesn't use the configuration.

Regards,

Néstor Boscán

-----Mensaje original-----
De: Vincent Bray [mailto:noodlet@gmail.com] Enviado el: Lunes, 17 de
Septiembre de 2007 01:55 p.m.
Para: users@httpd.apache.org
Asunto: Re: [users@httpd] NameVirtualHost question

On 18/09/2007, Néstor Boscán <ne...@tcs.com.ve> wrote:
> I have a server that has an Apache Server 1.3. The server only has 1 
> IP and can be access using two differente names server1 and server2. I 
> would like to create a VirtualHost for each name that sets the 
> ServerName. Now I tried the following

Try:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName server2
  ...
</VirtualHost>

--
noodl


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] NameVirtualHost question

Posted by Phillip Hamilton <ph...@myarchive.biz>.
WE need you to fill in the info here:

<VirtualHost server1:80>
  ServerName server1
  ... <======HERE
</VirtualHost>

<VirtualHost server2:80>
  ServerName server2
  ... <======HERE
</VirtualHost>

-----Original Message-----
From: Néstor Boscán [mailto:nestor.boscan@tcs.com.ve] 
Sent: Monday, September 17, 2007 2:00 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] NameVirtualHost question

Hi

Thanks for the quick answer.

But it didn't work. Tried that one and:

NameVirtualHost *:80

<VirtualHost server1:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost server2:80>
  ServerName server2
  ...
</VirtualHost>

And when I access the server using "server2" it doesn't take the VirtualHost
configuration. I have a ProxyPass inside VirtualHost for server2 and it
doesn't use the configuration.

Regards,

Néstor Boscán

-----Mensaje original-----
De: Vincent Bray [mailto:noodlet@gmail.com] 
Enviado el: Lunes, 17 de Septiembre de 2007 01:55 p.m.
Para: users@httpd.apache.org
Asunto: Re: [users@httpd] NameVirtualHost question

On 18/09/2007, Néstor Boscán <ne...@tcs.com.ve> wrote:
> I have a server that has an Apache Server 1.3. The server only has 1 
> IP and can be access using two differente names server1 and server2. I 
> would like to create a VirtualHost for each name that sets the 
> ServerName. Now I tried the following

Try:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName server2
  ...
</VirtualHost>

--
noodl


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] NameVirtualHost question

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Hi

Thanks for the quick answer.

But it didn't work. Tried that one and:

NameVirtualHost *:80

<VirtualHost server1:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost server2:80>
  ServerName server2
  ...
</VirtualHost>

And when I access the server using "server2" it doesn't take the VirtualHost
configuration. I have a ProxyPass inside VirtualHost for server2 and it
doesn't use the configuration.

Regards,

Néstor Boscán

-----Mensaje original-----
De: Vincent Bray [mailto:noodlet@gmail.com] 
Enviado el: Lunes, 17 de Septiembre de 2007 01:55 p.m.
Para: users@httpd.apache.org
Asunto: Re: [users@httpd] NameVirtualHost question

On 18/09/2007, Néstor Boscán <ne...@tcs.com.ve> wrote:
> I have a server that has an Apache Server 1.3. The server only has 1 
> IP and can be access using two differente names server1 and server2. I 
> would like to create a VirtualHost for each name that sets the 
> ServerName. Now I tried the following

Try:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName server2
  ...
</VirtualHost>

--
noodl


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] NameVirtualHost question

Posted by Vincent Bray <no...@gmail.com>.
On 18/09/2007, Néstor Boscán <ne...@tcs.com.ve> wrote:
> I have a server that has an Apache Server 1.3. The server only has 1 IP and
> can be access using two differente names server1 and server2. I would like
> to create a VirtualHost for each name that sets the ServerName. Now I tried
> the following

Try:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName server1
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName server2
  ...
</VirtualHost>

-- 
noodl