Last active
March 20, 2023 02:12
-
-
Save yongkangchen/06112fcaac32fd494c711424d5fd4654 to your computer and use it in GitHub Desktop.
apache2+cgi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apache2 conf: | |
<VirtualHost *:80> | |
DocumentRoot /var/www/html/cgidir | |
<Directory "/var/www/html/cgidir"> | |
AllowOverride All | |
</Directory> | |
</VirtualHost> | |
.htaccess: | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^/$ | |
RewriteRule ^ /index.html [L] | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule ^ - [L] | |
AddHandler cgi-script .py | |
Options +ExecCGI | |
RewriteRule ^(.*)$ /main.py?params=$1 [L,QSA] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment