File: smoke

package info (click to toggle)
libapache2-mod-python 3.5.0%2Bgit20211031.e6458ec-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,016 kB
  • sloc: python: 7,467; ansic: 7,037; makefile: 295; lex: 246; sh: 171
file content (23 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -e

cat >> /etc/apache2/apache2.conf <<EOT
<Directory /var/www/html/python/>
  SetHandler mod_python
  PythonHandler mod_python.publisher
</Directory>
EOT

mkdir /var/www/html/python
cat > /var/www/html/python/hello.py <<EOT
#!/usr/bin/python3

def index():
    return "Hello, world!\n"
EOT

a2enmod python
service apache2 reload

output=`wget -O- http://localhost/python/hello.py 2>/dev/null`
test "$output" = "Hello, world!"