You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by rd...@starband.net on 2002/11/16 05:11:30 UTC

Re[2]: [users@httpd] If Statements in httpd.conf file is this possible

Hello Joshua,
I am not looking to do URL manipulations. I need to do some stuff in
the httpd.conf file when it starts Apache.
Something like below
if ("/home/sites/home/certs/" = "") {
    $proto = 'http';
    $portnumber = '5000';
} else {
    $proto = 'https';
    $portnumber = '5001';
}


Friday, November 15, 2002, 6:01:16 PM, you wrote:



JS> On Fri, 15 Nov 2002 rdkurth@starband.net wrote:

>> If Statements in httpd.conf file is this possible and if so How would
>> I do it. Can I make it use perl,php or bash in the httpd file. so I can make it
>> read and use variables
>>
>> How can I do a if statement in the httpd.conf file.
>> I need to have it look in a directory to see if a file is there if it
>> is not I want it to get the file from a different directory.

JS> See "Search pages in more than one directory" under
JS> http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

JS> It's not exactly simple.

JS> Another technique is to point ErrorDocument 404 at a script that looks
JS> elsewhere for the content.

JS> Joshua.


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




-- 
Best regards,
 rdkurth                            mailto:rdkurth@starband.net


---------------------------------------------------------------------
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[2]: [users@httpd] If Statements in httpd.conf file is this possible

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 15 Nov 2002 rdkurth@starband.net wrote:

> Hello Joshua,
> I am not looking to do URL manipulations. I need to do some stuff in
> the httpd.conf file when it starts Apache.
> Something like below
> if ("/home/sites/home/certs/" = "") {
>     $proto = 'http';
>     $portnumber = '5000';
> } else {
>     $proto = 'https';
>     $portnumber = '5001';
> }

No, httpd.conf is not a programming language.

Two alternatives:

1. mod_perl allows essentially arbitrary perl code to be embedded in
httpd.conf.  I'd guess it could do something like this.

2. Use a pre-processor like m4 (or even a simple shell script) to
pre-process the httpd.conf and evaluate the conditions.

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