httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <>
Subject Re: [users@httpd] Processing config directives from the command line
Date Fri, 21 Sep 2007 22:09:06 GMT

On Sep 21, 2007, at 2:43 PM, Michael Andrews wrote:

> I have removed the Listen directive from my config and would like  
> to set it from the command line. I assume that is what the -C/c  
> flags are for:
> % ./apachectl -C "Listen 8080" -k start
> I keep getting dumped in to the -help and syntax page of httpd. It  
> does not seem to like the syntax. When I remove the 8080 (the value  
> part to the Listen directive) I get this:
> % ./apachectl -C "Listen" -k start
> Syntax error on line 1 of -c/-C directives:
> Listen requires 1 or 2 arguments.
> I thought simple quotes would work - but it does not seem to. Any  
> suggestions or insight would be appreciated.

apachectl is a shell script, so you can look inside to see and  
understand what happens.

As you can see, it is essentially a very thin wrapper around httpd -k  
$ARGV with ARGV set to whatever came in on the command line.  I  
expects start|stop|restart|graceful|etc., but anything after the -k  
argument should just sneak in... you'll have to take into account  
that the shell might strip away a level of quotes, so experiment with

apachectl start -C "\"Listen 8080\""

or something like that.  Experiment.

Or, depending on your circumstances and the other things apachectl  
does, just call httpd -k directly.


Sander Temme
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

View raw message