You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nick Edwards <ni...@gmail.com> on 2012/02/12 07:35:00 UTC

[users@httpd] vhosts conf file efficiency

Hi,

Is it more efficient for all virtualhost blocks to be in a single
file, eg httpd-vhosts.conf, or for each of them to be in their own
"one file per domain" via an include hosts.d/*.conf
We are talking a minimum of 2000 hosts per machine.

Memory I assume would be the same since it needs to know every domain,
but hows it for speed of starts?

Any other caveats, like file descriptor issues?

Thanks

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Nick Edwards <ni...@gmail.com>.
On 2/13/12, Noel Butler <no...@ausics.net> wrote:
> On Sun, 2012-02-12 at 13:14 +0000, Steve Swift wrote:
>
>>
>>
>>
>> One caveat: Don't ever rely on a a wildcard INCLUDE for the order of
>> your vhosts. This probably only matters for the first vhost, which is
>> the default for any request which doesn't match any vhost.
>>
>>
>
> It absolutely matters, for the very reason you gave.
>
> O.P:
> I can't comment either way on your initial request, I've always added
> all hosts into one vhosts.conf file, and to be honest I don't feel like
> splitting them all up into single files to test resource usage :) Though
> I'm sure someone else in the know can answer this,  it is the weekend
> still in half the world, so you might need to wait another day or three.
>
> That said, as Steve mentioned, if you do decide to use one file for each
> host, place your primary (first/default) vhost in httpd.conf, then after
> that entry, place your include statement to load the individual files.
>
>
Thanks, I would have been caught that way for sure, the default vhost
is a redirect to our main company site, hate to have oi redirect them
to some customers web site heh.

>

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Noel Butler <no...@ausics.net>.
On Sun, 2012-02-12 at 13:14 +0000, Steve Swift wrote:

> 
> 
> 
> One caveat: Don't ever rely on a a wildcard INCLUDE for the order of
> your vhosts. This probably only matters for the first vhost, which is
> the default for any request which doesn't match any vhost. 
> 
> 

It absolutely matters, for the very reason you gave.

O.P:
I can't comment either way on your initial request, I've always added
all hosts into one vhosts.conf file, and to be honest I don't feel like
splitting them all up into single files to test resource usage :) Though
I'm sure someone else in the know can answer this,  it is the weekend
still in half the world, so you might need to wait another day or three.

That said, as Steve mentioned, if you do decide to use one file for each
host, place your primary (first/default) vhost in httpd.conf, then after
that entry, place your include statement to load the individual files.



Re: [users@httpd] vhosts conf file efficiency

Posted by Sean Conner <sp...@conman.org>.
It was thus said that the Great Noel Butler once stated:
> On Mon, 2012-02-13 at 22:10 -0500, Sean Conner wrote:
> > > 
> > > So its going to open, read and close 2000 files, rather than open, read
> > > and close one file, that may or may not be noticeable at
> > > startup/reloads, if I was a betting man, I'd say noticeable.
> > 
> >   Nope.  I just ran a program [1] that opened and read 25,018 files in 2.5
> > seconds [2].  I'd bet unnoticeable.
> 
> Bored, so I tried it, only on a lightly used server (408 hosts) wrote
> quick 'n dirty perl  to split them into individuals and into a test dir
> 
> firstly in normal state....
> 
> time ./rc.httpd start
> Starting Apache... Done.
> 
> real	0m0.336s
> user	0m0.252s
> sys	0m0.040s
> 
> Now edited httpd.conf to exclude vhosts.conf but include
> conf/test/*.conf
> 
> time ./rc.httpd start
> Starting Apache... Done.
> 
> real	0m1.087s
> user	0m0.284s
> sys	0m0.040s

  Interesting.  Both user and sys time is similar, only the real time is
different, and that, I would attribute to the system having to read in the
files off the disk (a cold file cache).  

  -spc (Hmm ... looks like I lost that bet 8-)



---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Noel Butler <no...@ausics.net>.
On Mon, 2012-02-13 at 22:10 -0500, Sean Conner wrote:


> > 
> > So its going to open, read and close 2000 files, rather than open, read
> > and close one file, that may or may not be noticeable at
> > startup/reloads, if I was a betting man, I'd say noticeable.
> 
>   Nope.  I just ran a program [1] that opened and read 25,018 files in 2.5
> seconds [2].  I'd bet unnoticeable.
> 



Bored, so I tried it, only on a lightly used server (408 hosts) wrote
quick 'n dirty perl  to split them into individuals and into a test dir

firstly in normal state....

time ./rc.httpd start
Starting Apache... Done.

real	0m0.336s
user	0m0.252s
sys	0m0.040s

Now edited httpd.conf to exclude vhosts.conf but include
conf/test/*.conf

time ./rc.httpd start
Starting Apache... Done.

real	0m1.087s
user	0m0.284s
sys	0m0.040s


so half a second more reading 400 odd individual files, so over 2000 it
would take a few seconds more, in nit picking, yes it would be worse
off, if you can call 3 or so seconds more, worse off :)



Re: [users@httpd] vhosts conf file efficiency

Posted by Noel Butler <no...@ausics.net>.
On Tue, 2012-02-14 at 12:18 -0500, Sean Conner wrote:

> It was thus said that the Great Tom Evans once stated:
> > On Tue, Feb 14, 2012 at 4:32 PM, Sean Conner <sp...@conman.org> wrote:
> > >  And really, how often is Apache restarted?  On a graceful restart, it can
> > > still serve requests.
> > >
> > 
> > It's clear you have a strong opinion on this. I prefer my mission
> > critical systems not take longer than necessary to start up, whilst
> > you don't seem to mind. Each to their own.
> 
>   What I dislike are statements like "it's faster to put all vhosts in your
> main configuration file" without anything to back it up.  Noel Butler at
> least provided some numbers (1 second for 400 files) so people have *some*
> benchmark to go by.  
> 
>   So I can live with 5 seconds for 2,000 files if it makes administration
> easier on the rare occasions that Apache needs to be fully restarted (not
> just a graceful restart).  You prefer to save those five seconds, but don't
> mind editing a file with 2,000 vhosts.


I got bored again, using my dev box,
Note, being a dev box, I can afford the luxury of rebooting before each
test to ensure no caching...
The VH segments we use in the real world are twice as big with suexec,
rewrites, php flags and Dir specific options, but this should give you
some sort of idea using a very, very, plain and bare bones config... 

If the OP is that worried, he can use the script to do a dummy run using
all his real world config sections, which likely are two or three times
bigger than the bare test below...

Created 2000 files (see below)

 time /etc/rc.d/rc.httpd start

real    0m7.490s
user    0m1.044s
sys     0m0.584s

ls -la /usr/local/apache/conf/vhosts/2000test.com.conf 
-rw-r--r-- 1 root root 524 Feb 15
13:25 /usr/local/apache/conf/vhosts/2000test.com.conf



Slightly changed the "open" to send to all one conf file

time /etc/rc.d/rc.httpd start

real    0m5.623s
user    0m0.976s
sys     0m0.444s


ls -lah /usr/local/apache/conf/vhosts/hosts.conf 
-rw-r--r-- 1 root root 1.6M Feb 15
13:19 /usr/local/apache/conf/vhosts/hosts.conf



Test script used -

for ($count = 2000; $count >= 1; $count--) {
$DOMAIN = $count ."test.com";
$htroot ="/var/www/vhosts/".$DOMAIN;
mkdir($htroot);
mkdir("$htroot/logs");
mkdir("$htroot/web");
mkdir("$htroot/cgi");
open (STUFF, ">/usr/local/apache/conf/vhosts/$DOMAIN.conf");
print STUFF <<EOF;
 
<VirtualHost 10.10.0.222>
        ServerName      www.$DOMAIN
        ServerAlias     $DOMAIN
        ServerAdmin     webmaster\@$DOMAIN
        DocumentRoot    $htroot/web
        ScriptAlias     /cgi-bin/ $htroot/cgi/
        CustomLog       $htroot/logs/access_log combined
        ErrorLog        $htroot/logs/error_log
        UserDir disabled
</VirtualHost>

EOF
close STUFF;
}



Re: [users@httpd] vhosts conf file efficiency

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Feb 14, 2012 at 5:18 PM, Sean Conner <sp...@conman.org> wrote:
> It was thus said that the Great Tom Evans once stated:
>> On Tue, Feb 14, 2012 at 4:32 PM, Sean Conner <sp...@conman.org> wrote:
>> >  And really, how often is Apache restarted?  On a graceful restart, it can
>> > still serve requests.
>> >
>>
>> It's clear you have a strong opinion on this. I prefer my mission
>> critical systems not take longer than necessary to start up, whilst
>> you don't seem to mind. Each to their own.
>
>  What I dislike are statements like "it's faster to put all vhosts in your
> main configuration file" without anything to back it up.

Common sense? Experience? Understanding that loading 20,000 1k files
off disk is magnitudes slower than loading a single 20M file off disk?

> Noel Butler at
> least provided some numbers (1 second for 400 files) so people have *some*
> benchmark to go by.
>
>  So I can live with 5 seconds for 2,000 files if it makes administration
> easier on the rare occasions that Apache needs to be fully restarted (not
> just a graceful restart).  You prefer to save those five seconds, but don't
> mind editing a file with 2,000 vhosts.
>

I definitely prefer saving 5 seconds, but I never said that I would
edit a file with 20k vhosts in it, you have inferred that.

Cheers

Tom

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Sean Conner <sp...@conman.org>.
It was thus said that the Great Tom Evans once stated:
> On Tue, Feb 14, 2012 at 4:32 PM, Sean Conner <sp...@conman.org> wrote:
> >  And really, how often is Apache restarted?  On a graceful restart, it can
> > still serve requests.
> >
> 
> It's clear you have a strong opinion on this. I prefer my mission
> critical systems not take longer than necessary to start up, whilst
> you don't seem to mind. Each to their own.

  What I dislike are statements like "it's faster to put all vhosts in your
main configuration file" without anything to back it up.  Noel Butler at
least provided some numbers (1 second for 400 files) so people have *some*
benchmark to go by.  

  So I can live with 5 seconds for 2,000 files if it makes administration
easier on the rare occasions that Apache needs to be fully restarted (not
just a graceful restart).  You prefer to save those five seconds, but don't
mind editing a file with 2,000 vhosts.

  -spc




---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Feb 14, 2012 at 4:32 PM, Sean Conner <sp...@conman.org> wrote:
>  And really, how often is Apache restarted?  On a graceful restart, it can
> still serve requests.
>

It's clear you have a strong opinion on this. I prefer my mission
critical systems not take longer than necessary to start up, whilst
you don't seem to mind. Each to their own.

Cheers

Tom

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Sean Conner <sp...@conman.org>.
It was thus said that the Great Tom Evans once stated:
> On Tue, Feb 14, 2012 at 3:10 AM, Sean Conner <sp...@conman.org> wrote:
> >  Nope.  I just ran a program [1] that opened and read 25,018 files in 2.5
> > seconds [2].  I'd bet unnoticeable.
> >
> 
> So that is an extra 5 seconds on a graceful restart - apache will read
> the config once, throw it away, and then read it again, so it has to
> read those 20,000 files twice. 5 seconds not serving requests is not
> ideal.

  The original example had 2000 files.  I found a directory tree on my
machine with 20,000 files.  It's what I had.

> Probably best to avoid that cost if you can. You could use a
> pre-processor to assemble the config files into one file, but that has
> the downside of complicating the whole process.

  And really, how often is Apache restarted?  On a graceful restart, it can
still serve requests.  

  -spc



---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Feb 14, 2012 at 3:10 AM, Sean Conner <sp...@conman.org> wrote:
>  Nope.  I just ran a program [1] that opened and read 25,018 files in 2.5
> seconds [2].  I'd bet unnoticeable.
>

So that is an extra 5 seconds on a graceful restart - apache will read
the config once, throw it away, and then read it again, so it has to
read those 20,000 files twice. 5 seconds not serving requests is not
ideal.

Probably best to avoid that cost if you can. You could use a
pre-processor to assemble the config files into one file, but that has
the downside of complicating the whole process.

Cheers

Tom

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Sean Conner <sp...@conman.org>.
It was thus said that the Great Noel Butler once stated:
> On Tue, 2012-02-14 at 12:21 +1000, Nick Edwards wrote:
> 
> > On 2/12/12, Steve Swift <Sw...@swiftys.org.uk> wrote:
> > > I don't think it would make a significant difference if you had a single
> > > file with 2000 vhosts, or 2000 files with one vhost each.
> > >
> > 
> > I think you're right, I added half a dozen test domains and checked
> 
> 
> Remember,
> 
> openfile 1
> readfile 1
> closefile 1
>    ...
> openfile 2000
> readfile 2000
> closefile 2000
> 
> So its going to open, read and close 2000 files, rather than open, read
> and close one file, that may or may not be noticeable at
> startup/reloads, if I was a betting man, I'd say noticeable.

  Nope.  I just ran a program [1] that opened and read 25,018 files in 2.5
seconds [2].  I'd bet unnoticeable.

  -spc (But given that Apache starts/restarts should be rare anyway ... )

[1]	It effectively runs the Unix command "file" over a large number of
	files.

[2]	1G RAM, 2.6GHz Pentium

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Noel Butler <no...@ausics.net>.
On Tue, 2012-02-14 at 12:21 +1000, Nick Edwards wrote:

> On 2/12/12, Steve Swift <Sw...@swiftys.org.uk> wrote:
> > I don't think it would make a significant difference if you had a single
> > file with 2000 vhosts, or 2000 files with one vhost each.
> >
> 
> I think you're right, I added half a dozen test domains and checked


Remember,

openfile 1
readfile 1
closefile 1
   ...
openfile 2000
readfile 2000
closefile 2000

So its going to open, read and close 2000 files, rather than open, read
and close one file, that may or may not be noticeable at
startup/reloads, if I was a betting man, I'd say noticeable.




[users@httpd] checking my httpd.conf

Posted by florent larose <fl...@hotmail.com>.
ok that works!
Thanks a lot.

From: yehuda@ymkatz.net
Date: Tue, 14 Feb 2012 14:28:07 -0500
To: users@httpd.apache.org
Subject: Re: [users@httpd] checking my httpd.conf

On Tue, Feb 14, 2012 at 2:22 PM, florent larose <fl...@hotmail.com> wrote:






well apache_error.log ->
[Tue Feb 14 20:05:05 2012] [notice] Apache/2.0.63 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Tue Feb 14 20:05:05 2012] [notice] Server built: Jan 17 2008 22:58:29
[Tue Feb 14 20:05:06 2012] [notice] Parent: Created child process 2488


[Tue Feb 14 20:05:06 2012] [notice] Child 2488: Child process is running
[Tue Feb 14 20:05:06 2012] [notice] Child 2488: Acquired the start mutex.
[Tue Feb 14 20:05:06 2012] [notice] Child 2488: Starting 250 worker threads.


[Tue Feb 14 20:05:09 2012] [alert] [client 127.0.0.1] C:/Program Files/Zend/ZendFramework-1.11.11/quick/public/.htaccess: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration



That is the message I obtain after i launch Apache for the last time.

You need to enable mod_rewrite:Around line 164 of httpd.conf, remove the '#' at the beginning of the line so that it says

LoadModule rewrite_module modules/mod_rewrite.so

Then restart the webserver.
- Y 		 	   		  

Re: [users@httpd] checking my httpd.conf

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Tue, Feb 14, 2012 at 2:22 PM, florent larose
<fl...@hotmail.com>wrote:

>  well apache_error.log ->
> [Tue Feb 14 20:05:05 2012] [notice] Apache/2.0.63 (Win32) PHP/5.2.6
> configured -- resuming normal operations
> [Tue Feb 14 20:05:05 2012] [notice] Server built: Jan 17 2008 22:58:29
> [Tue Feb 14 20:05:06 2012] [notice] Parent: Created child process 2488
> [Tue Feb 14 20:05:06 2012] [notice] Child 2488: Child process is running
> [Tue Feb 14 20:05:06 2012] [notice] Child 2488: Acquired the start mutex.
> [Tue Feb 14 20:05:06 2012] [notice] Child 2488: Starting 250 worker
> threads.
> [Tue Feb 14 20:05:09 2012] [alert] [client 127.0.0.1] C:/Program
> Files/Zend/ZendFramework-1.11.11/quick/public/.htaccess: Invalid command
> 'RewriteEngine', perhaps mis-spelled or defined by a module not included in
> the server configuration
>
> That is the message I obtain after i launch Apache for the last time.
>

You need to enable mod_rewrite:
Around line 164 of httpd.conf, remove the '#' at the beginning of the line
so that it says

> LoadModule rewrite_module modules/mod_rewrite.so

Then restart the webserver.

- Y

[users@httpd] checking my httpd.conf

Posted by florent larose <fl...@hotmail.com>.
well apache_error.log ->
[Tue Feb 14 20:05:05 2012] [notice] Apache/2.0.63 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Tue Feb 14 20:05:05 2012] [notice] Server built: Jan 17 2008 22:58:29
[Tue Feb 14 20:05:06 2012] [notice] Parent: Created child process 2488
[Tue Feb 14 20:05:06 2012] [notice] Child 2488: Child process is running
[Tue Feb 14 20:05:06 2012] [notice] Child 2488: Acquired the start mutex.
[Tue Feb 14 20:05:06 2012] [notice] Child 2488: Starting 250 worker threads.
[Tue Feb 14 20:05:09 2012] [alert] [client 127.0.0.1] C:/Program Files/Zend/ZendFramework-1.11.11/quick/public/.htaccess: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration

That is the message I obtain after i launch Apache for the last time.

Concerning httpd.conf, here the line codes I modified :

<VirtualHost 127.0.0.1>
    ServerName quickstart.local
    DocumentRoot "c:\Program Files\Zend\ZendFramework-1.11.11\quick\public"
    
    SetEnv APPLICATION_ENV "development"
    
    <Directory "c:\Program Files\Zend\ZendFramework-1.11.11\quick\public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>
</VirtualHost>



From: yehuda@ymkatz.net
Date: Tue, 14 Feb 2012 14:04:55 -0500
To: users@httpd.apache.org
Subject: Re: [users@httpd] checking my httpd.conf

On Tue, Feb 14, 2012 at 1:55 PM, florent larose <fl...@hotmail.com> wrote:






ok for precedent checking...  -> Apache -t (syntax ok)
Now that my httpd .conf file is well configured, I launch 
my server and i have the internal Server Error 500 :
"The server encountered an internal error or
misconfiguration and was unable to complete
your request"

So it still no good... (the redirection of my localhost does not work despite my httpd.conf file is good !)
So what does your error_log (c:/wamp/logs/apache_error.log according to your httpd.conf) say?

 		 	   		  

Re: [users@httpd] checking my httpd.conf

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Tue, Feb 14, 2012 at 1:55 PM, florent larose
<fl...@hotmail.com>wrote:

>  ok for precedent checking...  -> Apache -t (syntax ok)
> Now that my httpd .conf file is well configured, I launch
> my server and i have the internal Server Error 500 :
> "The server encountered an internal error or misconfiguration and was
> unable to complete your request"
>
> So it still no good... (the redirection of my localhost does not work
> despite my httpd.conf file is good !)
>

So what does your error_log (c:/wamp/logs/apache_error.log according to
your httpd.conf) say?

[users@httpd] checking my httpd.conf

Posted by florent larose <fl...@hotmail.com>.
ok for precedent checking...  -> Apache -t (syntax ok)
Now that my httpd .conf file is well configured, I launch 
my server and i have the internal Server Error 500 :
"The server encountered an internal error or
misconfiguration and was unable to complete
your request"

So it still no good... (the redirection of my localhost does not work despite my httpd.conf file is good !)





From: florent.larose@hotmail.com
To: users@httpd.apache.org
Date: Tue, 14 Feb 2012 17:44:32 +0000
Subject: [users@httpd] checking my httpd.conf







Well, 
I try to check my httpd.conf file with the command:
Apache -t
Now i obtain the following error message :
"syntax error on line 961 of c:\wamp\bin\apache\apache2.0.63\conf\httpd.conf -- it is my httpd.conf path
: DocumentRoot takes one argument, Root directory of the document tree"

What does it mean ? what must I do ?
Thanks for your help.


> Date: Tue, 14 Feb 2012 14:16:17 +0100
> From: fedora@ayni.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] checking my httpd.conf
> 
> Hi Florent
> give your apache-binary the -t parameter, and it will check your config 
> files for correctnes. e.g.
> 
> httpd -t
> or
> apache2 -t
> 
> suomi
> 
> On 02/14/2012 10:13 AM, florent larose wrote:
> >
> > hello,
> > i 'm installing ZendFrameworkans i need to check my httpd.conf
> > here is my file for checking
> > Note : I did modifications on the following line codes :
> > line 945 and line 959 to line 969
> > (indded i want to have my localhost redirect to a virtual host
> > : the servername is "quickstat.local" with a redirection to entry
> > "127.0.0.1" at port 80)
> > is there a problem with my httpd.conf file ?
> > Thanks for your help.
> >
> > (my apache version : 2.0.63)
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 
 		 	   		   		 	   		  

[users@httpd] checking my httpd.conf

Posted by florent larose <fl...@hotmail.com>.
Thanks for your rapid response
to answer your question my DocumentRoot as it appears in my httpd.conf file :
DocumentRoot c:\Program Files\Zend\ZendFramework-1.11.11\quick\public

Is it correct?
Thanks for your help.

From: yehuda@ymkatz.net
Date: Tue, 14 Feb 2012 12:47:28 -0500
To: users@httpd.apache.org
Subject: Re: [users@httpd] checking my httpd.conf

On Tue, Feb 14, 2012 at 12:44 PM, florent larose <fl...@hotmail.com> wrote:






Well, 
I try to check my httpd.conf file with the command:
Apache -t
Now i obtain the following error message :
"syntax error on line 961 of c:\wamp\bin\apache\apache2.0.63\conf\httpd.conf -- it is my httpd.conf path


: DocumentRoot takes one argument, Root directory of the document tree"

What does it mean ? what must I do ?
Thanks for your help.

What does that line in httpd.conf actually say? (Hint: use a program like Notepad++ that has a Go-To-Line-Number___ feature.)


If I had to guess, your DocumentRoot has a space in it, so you need to make sure the whole thing is in quotes.
- Y  		 	   		  

Re: [users@httpd] checking my httpd.conf

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Tue, Feb 14, 2012 at 12:47 PM, Yehuda Katz <ye...@ymkatz.net> wrote:

> On Tue, Feb 14, 2012 at 12:44 PM, florent larose <
> florent.larose@hotmail.com> wrote:
>
>>  Well,
>> I try to check my httpd.conf file with the command:
>> Apache -t
>> Now i obtain the following error message :
>> "syntax error on line 961 of
>> c:\wamp\bin\apache\apache2.0.63\conf\httpd.conf -- it is my httpd.conf path
>> : DocumentRoot takes one argument, Root directory of the document tree"
>>
>> What does it mean ? what must I do ?
>> Thanks for your help.
>>
>
> What does that line in httpd.conf actually say? (Hint: use a program like
> Notepad++ that has a Go-To-Line-Number___ feature.)
>
> If I had to guess, your DocumentRoot has a space in it, so you need to
> make sure the whole thing is in quotes.
>

Forget the guess, my anti-virus had removed your original attachment
because it had a "Unknown Type".
Usually on Windows, you convert the backslashes to forward slashes and put
the whole thing in quotes:

<VirtualHost 127.0.0.1>
>     ServerName quickstart.local
> DocumentRoot "C:/Program Files/Zend/ZendFramework-1.11.11/quick/public"
>  SetEnv APPLICATION_ENV "development"
> <Directory  "C:/Program Files/Zend/ZendFramework-1.11.11/quick/public" >
> DirectoryIndex index.php
>  AllowOverride All
> Order allow, deny
> Allow from All
>  </Directory>
> </VirtualHost>

Re: [users@httpd] checking my httpd.conf

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Tue, Feb 14, 2012 at 12:44 PM, florent larose <florent.larose@hotmail.com
> wrote:

>  Well,
> I try to check my httpd.conf file with the command:
> Apache -t
> Now i obtain the following error message :
> "syntax error on line 961 of
> c:\wamp\bin\apache\apache2.0.63\conf\httpd.conf -- it is my httpd.conf path
> : DocumentRoot takes one argument, Root directory of the document tree"
>
> What does it mean ? what must I do ?
> Thanks for your help.
>

What does that line in httpd.conf actually say? (Hint: use a program like
Notepad++ that has a Go-To-Line-Number___ feature.)

If I had to guess, your DocumentRoot has a space in it, so you need to make
sure the whole thing is in quotes.

- Y

[users@httpd] checking my httpd.conf

Posted by florent larose <fl...@hotmail.com>.
Well, 
I try to check my httpd.conf file with the command:
Apache -t
Now i obtain the following error message :
"syntax error on line 961 of c:\wamp\bin\apache\apache2.0.63\conf\httpd.conf -- it is my httpd.conf path
: DocumentRoot takes one argument, Root directory of the document tree"

What does it mean ? what must I do ?
Thanks for your help.


> Date: Tue, 14 Feb 2012 14:16:17 +0100
> From: fedora@ayni.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] checking my httpd.conf
> 
> Hi Florent
> give your apache-binary the -t parameter, and it will check your config 
> files for correctnes. e.g.
> 
> httpd -t
> or
> apache2 -t
> 
> suomi
> 
> On 02/14/2012 10:13 AM, florent larose wrote:
> >
> > hello,
> > i 'm installing ZendFrameworkans i need to check my httpd.conf
> > here is my file for checking
> > Note : I did modifications on the following line codes :
> > line 945 and line 959 to line 969
> > (indded i want to have my localhost redirect to a virtual host
> > : the servername is "quickstat.local" with a redirection to entry
> > "127.0.0.1" at port 80)
> > is there a problem with my httpd.conf file ?
> > Thanks for your help.
> >
> > (my apache version : 2.0.63)
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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] checking my httpd.conf

Posted by fedora <fe...@ayni.com>.
Hi Florent
give your apache-binary the -t parameter, and it will check your config 
files for correctnes. e.g.

httpd -t
or
apache2 -t

suomi

On 02/14/2012 10:13 AM, florent larose wrote:
>
> hello,
> i 'm installing ZendFrameworkans i need to check my httpd.conf
> here is my file for checking
> Note : I did modifications on the following line codes :
> line 945 and line 959 to line 969
> (indded i want to have my localhost redirect to a virtual host
> : the servername is "quickstat.local" with a redirection to entry
> "127.0.0.1" at port 80)
> is there a problem with my httpd.conf file ?
> Thanks for your help.
>
> (my apache version : 2.0.63)
>
>
>
> ---------------------------------------------------------------------
> 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


[users@httpd] checking my httpd.conf

Posted by florent larose <fl...@hotmail.com>.

hello,
i 'm installing ZendFrameworkans i need to check my httpd.conf
here is my file for checking
Note : I did modifications on the following line codes :
line 945 and line 959 to line 969
(indded i want to have my localhost redirect to a virtual host
: the servername is "quickstat.local" with a redirection to entry 
"127.0.0.1" at port 80)
is there a problem with my httpd.conf file ?
Thanks for your help.

(my apache version : 2.0.63)
 		 	   		  

Re: [users@httpd] vhosts conf file efficiency

Posted by Nick Edwards <ni...@gmail.com>.
On 2/12/12, Steve Swift <Sw...@swiftys.org.uk> wrote:
> I don't think it would make a significant difference if you had a single
> file with 2000 vhosts, or 2000 files with one vhost each.
>

I think you're right, I added half a dozen test domains and checked
lsof, no apparent extra file handles.  Just if I have to rebuild a
machine I was hoping it would be easier, one of the scripts that
deletes  ex-customers had a glitch and deleted hundreds of domains
(thank heavens for hourly backups of config files), I assume it was a
connection issue to server that caused it because the script has
worked hundreds of times in removing those one year wonder domains
that don't get renewed, and did not occur again when I tried to test
it since, and if it can happen once, no mater the reason, it can
happen again, so I was looking at alternatives, ones that do not
impact negatively.

---------------------------------------------------------------------
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] vhosts conf file efficiency

Posted by Steve Swift <Sw...@swiftys.org.uk>.
I don't think it would make a significant difference if you had a single
file with 2000 vhosts, or 2000 files with one vhost each.

Having them all in one file would make life easier if you needed to make a
global change.

One caveat: Don't ever rely on a a wildcard INCLUDE for the order of your
vhosts. This probably only matters for the first vhost, which is the
default for any request which doesn't match any vhost.

On 12 February 2012 06:35, Nick Edwards <ni...@gmail.com> wrote:

> Hi,
>
> Is it more efficient for all virtualhost blocks to be in a single
> file, eg httpd-vhosts.conf, or for each of them to be in their own
> "one file per domain" via an include hosts.d/*.conf
> We are talking a minimum of 2000 hosts per machine.
>
> Memory I assume would be the same since it needs to know every domain,
> but hows it for speed of starts?
>
> Any other caveats, like file descriptor issues?
>
> Thanks
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Steve Swift
http://www.swiftys.org.uk