0

I want to have Apache run a script every time it gets a request. To be clear I want apache to serve the actual file and just have this script called right before Apache handles the request (I have my own script that needs to do some custom logging).

I tried:

 <VirtualHost *:80>
    ServerName voice1.example.org
    DocumentRoot /var/www/html/
    <directory "/">
            Script GET "/test.php"
    </directory>
    ErrorLog /var/log/httpd/dovid.log
    LogLevel info
    CustomLog /var/log/httpd/dovid.access.log combined

as well as

 <VirtualHost *:80>
    ServerName voice1.example.org
    DocumentRoot /var/www/html/
    <directory "/">
             Action pre-script /var/www/html/test.php
            SetHandler pre-script
    </directory>
    ErrorLog /var/log/httpd/dovid.log
    LogLevel info
    CustomLog /var/log/httpd/dovid.access.log combined

Both don't seem to work. What am I doing wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.