PDA

View Full Version : Apache2.conf



JRWoodwardMSW
2022-07-25, 11:05
Can anybody point me to a sample apache2.conf file with the correct directives for using php and python? I'm running php8.1 and the current versions of Kali and python.

Fred Sheehan
2022-07-26, 22:10
You need to allow the correct module to run, and set it up, for example for PHP..

LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

<Directory /usr/local/var/www/>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$index.php?q=$1 [L,QSA]
</Directory>

You need to set up the correct file paths of course, according to your system or preferences thats from my set up on Mac OSX, but that should give you some idea..