After mod_python is installed, test the python code displayed on the webpage? Prawns are saving lives.
Source: Internet
Author: User
After mod_python is installed, test the python code displayed on the webpage? Let's take a look at the Linux Enterprise Application-Linux server application information. For more information, see below. The installation process is as follows:
# Tar-zxvf httpd-2.0.54.tar.gz
# Cd httpd-2.0.54
#./Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-mod-shared = all
# Make install clean
#...
# Tar-zxvf mod_python-3.3.1.tgz
# Cd mod_python-3.3.1
#./Configure -- with-apxs =/usr/local/apache2/bin/apxs -- with-python =/usr/local/bin/python
# Make install clean
After installing apache and mod_python
In two steps:
(1) create a mypy folder under/htdocs and change the permission so that all users can access
Create a file named mytest. py, and enter:
From mod_python import apache
Def handler (req ):
Req. write ("hello world ")
Return apache. OK
(2) modify the apache configuration file httpd. conf and add the following statement.
LoadModule python_module modules/mod_python.so
AddHandler mod_python. py
PythonHandler mytest
PythonDebug On
Restart apache and access mytest. The python code is displayed!
Why is it for help ???
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service