File: appendixb.tex

package info (click to toggle)
libapache-mod-python 2%3A2.7.10-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,352 kB
  • ctags: 853
  • sloc: ansic: 2,785; python: 1,123; makefile: 298; sh: 172
file content (137 lines) | stat: -rw-r--r-- 4,486 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
\chapter{VMS installation\label{app-vnsinst}}

\indexii{VMS}{installation}

\begin{verbatim}

How to build and install mod_python on a VMS system

James Gessling <jgessling@yahoo.com> Fri, 3 Nov 2000 

This assumes apache and python already installed successfully.  I tested
Compaq's CSWS version and 1.3.12 version's of Apache.  Python was 1.5.2 from
http://decus.decus.de/~zessin/python.

0) download current release (wrote this for 2.6.3) from www.modpython.org.

1) create directories on a VMS system something like:

dka0:[mod_python.src.include]

2) put the .c files in src, the .h in include

3) Cut the script off the end of this file, save it in the src directory.  
Edit as necessary and use it to compile and link mod_python.exe.  Sorry,
I didn't make much effort to make it very sophisticated.

4) Under your python lib directory, add a subdirectory [.mod_python].

For example: dka100:[python.python-1_5_2.lib]

5) Populate this subdirectory with mod_python .py files.
This allows for module importing like:

    import mod_python.apache

which will find apache.py
\end{verbatim}
\begin{verbatim}
6) Edit apache$root:[conf]httpd.conf to add line:

   Include /apache$root/conf/mod_python.conf

(typically at the end of the file)

7) create apache$root:[conf]mod_python.conf containing:

############################################################################
##
# Mod_Python config
############################################################################
##
#
# Load the dynamic MOD_PYTHON module
# note pythonpath must be in python list literal format
#
LoadModule PYTHON_MODULE modules/mod_python.exe

<Directory />
    AddHandler python-program .py
    PythonHandler mptest
    PythonDebug On
    PythonPath
"['/dka100/python/python-1_5_2/lib','/dka100/python/python-1_5_2/
vms/tools','/apache$root/htdocs/python']"
</Directory>
#

8) put mod_python.exe into apache$common:[modules] so it can be found and
loaded.  (create the directory if required).  

9) fire up the web server with @sys$startup:apache$startup

10) Create a file mptest.py in a python subdirectory of your document root,  
Typically apache$common:[htdocs.python].  Like this:

      from mod_python import apache

      def handler(req):
          req.send_http_header()
          req.write("Hello World!")
          return apache.OK 

( watch your indenting, as usual )

11) point browser to:  http://node.place.com/python/mptest.py

12) enjoy "hello world"
\end{verbatim}
\begin{verbatim}
$! build script, edit as needed to match the directories where your
$!               files are located.  Note /nowarning on cc, this is
$!               required because of a #define clash between apache
$!               and python.  If not used, the .exe is marked as
$!               having compilation warnings and won't load. Apache
$!               should already have been started to create apache$httpd_shr
$!               logical name,  Running the apache server with the -X flag
$!               as an interactive process can be used for debugging if
$!               necessary.
$ set noon
$ library/create mod_python_lib
$ cc :== cc  /nowarning/prefix=all/include=(dka100:[python.python-1_5_2],-
                         dka100:[python.python-1_5_2.include],-
                         dka0:[],-
                         dka200:[apache.apache.src.include],-
                         dka200:[apache.apache.src.os.openvms]) 
$ cc  _apachemodule
$ library/insert mod_python_lib  _apachemodule
$ cc  connobject
$ library/insert mod_python_lib  connobject
$ cc  mod_python
$ cc  requestobject
$ library/insert mod_python_lib  requestobject
$ cc  serverobject
$ library/insert mod_python_lib  serverobject
$ cc  tableobject
$ library/insert mod_python_lib  tableobject
$ cc  util
$ library/insert mod_python_lib  util
$!   mod_python
$ link/share/sysexe mod_python,sys$input/opt
SYMBOL_VECTOR=(PYTHON_MODULE=DATA)
mod_python_lib/lib
apache$httpd_shr/share
dka100:[python.python-1_5_2.vms.o_alpha]python_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]modules_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]vms_macro_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]objects_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]parser_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]vms_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]modules_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]vms_macro_d00/lib
dka100:[python.python-1_5_2.vms.o_alpha]vms_d00/lib
case_sensitive=no
$!
$ exit

\end{verbatim}