1
2
3
4
5
|
xpleaf@leaf:~/下载$
tar
xvf apr-1.5.2.
tar
.gz
......
apr-1.5.2
/mmap/win32/
apr-1.5.2
/mmap/win32/mmap
.c
apr-1.5.2
/apr-config
.
in
|
1
2
3
4
5
6
|
xpleaf@leaf:~/下载
/apr-1
.5.2$ .
/configure
......
config.status: creating include
/arch/unix/apr_private
.h
config.status: executing libtool commands
rm
: cannot remove
'libtoolT'
: No such
file
or directory
config.status: executing default commands
|
1
2
3
4
|
xpleaf@leaf:~/下载
/apr-1
.5.2$
make
......
xpleaf@leaf:~/下载
/apr-1
.5.2$
sudo
make
install
......
|
1
2
3
4
5
6
7
8
|
xpleaf@leaf:~/下载
/apr-util-1
.5.4$ .
/configure
......
checking whether gcc accepts -g...
yes
checking
for
gcc option to accept ISO C89... none needed
Applying apr-util hints
file
rules
for
x86_64-unknown-linux-gnu
checking
for
APR... no
configure: error: APR could not be located. Please use the --with-apr option.
#注意看上面的报错提示
|
1
2
|
xpleaf@leaf:~/下载
/apr-util-1
.5.4$
whereis
apr
apr:
/usr/local/apr
|
1
2
3
4
5
|
xpleaf@leaf:~/下载
/apr-util-1
.5.4$ .
/configure
--with-apr=
/usr/local/apr
......
config.status: creating
test
/Makefile
config.status: creating include
/private/apu_config
.h
config.status: executing default commands
|
1
2
|
xpleaf@leaf:~/下载
/apr-util-1
.5.4$
make
xpleaf@leaf:~/下载
/apr-util-1
.5.4$
sudo
make
install
|
1
2
3
4
|
xpleaf@leaf:~/下载$
tar
zxvf pcre-8.38.
tar
.gz
xpleaf@leaf:~/下载
/pcre-8
.38$ .
/configure
xpleaf@leaf:~/下载
/pcre-8
.38$
make
xpleaf@leaf:~/下载
/pcre-8
.38$
sudo
make
install
|
1
2
3
4
|
xpleaf@leaf:~/下载$
tar
zxvf httpd-2.4.18.
tar
.gz
xpleaf@leaf:~/下载
/httpd-2
.4.18$ .
/configure
--
enable
-module=shared
xpleaf@leaf:~/下载
/httpd-2
.4.18$
make
xpleaf@leaf:~/下载
/httpd-2
.4.18$
sudo
make
install
|
1
2
|
xpleaf@leaf:~$
whereis
apache2
apache2:
/usr/local/apache2
|
1
2
|
xpleaf@leaf:~$
sudo
/usr/local/apache2/bin/apachectl
start
/usr/local/apache2/bin/httpd
: error
while
loading shared libraries: libpcre.so.1: cannot
open
shared object
file
: No such
file
or directory
|
1
2
3
4
5
6
7
8
9
10
11
|
xpleaf@leaf:~$ ldd
/usr/local/apache2/bin/httpd
linux-vdso.so.1 => (0x00007ffdf9fe6000)
libpcre.so.1 => not found
libaprutil-1.so.0 =>
/usr/local/apr/lib/libaprutil-1
.so.0 (0x00007f8192a47000)
libapr-1.so.0 =>
/usr/local/apr/lib/libapr-1
.so.0 (0x00007f8192813000)
libpthread.so.0 =>
/lib/x86_64-linux-gnu/libpthread
.so.0 (0x00007f81925f5000)
libc.so.6 =>
/lib/x86_64-linux-gnu/libc
.so.6 (0x00007f819222b000)
libexpat.so.0 =>
/usr/local/apr/lib/libexpat
.so.0 (0x00007f8192002000)
libcrypt.so.1 =>
/lib/x86_64-linux-gnu/libcrypt
.so.1 (0x00007f8191dca000)
libdl.so.2 =>
/lib/x86_64-linux-gnu/libdl
.so.2 (0x00007f8191bc6000)
/lib64/ld-linux-x86-64
.so.2 (0x00005637a587b000)
|
1
|
xpleaf@leaf:~$
sudo
ln
-s
/usr/local/lib/libpcre
.so.1
/lib
|
1
2
|
xpleaf@leaf:~$
sudo
/usr/local/apache2/bin/apachectl
start
AH00558: httpd: Could not reliably determine the server
's fully qualified domain name, using 127.0.1.1. Set the '
ServerName' directive globally to suppress this message
|
1
|
#LoadModule cgid_module modules/mod_cgid.so
|
1
|
LoadModule cgid_module modules
/mod_cgid
.so
|
1
|
ScriptAlias
/cgi-bin/
"/usr/local/apache2/cgi-bin/"
|
1
|
ScriptAlias
/cgi-bin/
/home/xpleaf/Source_Code/cgi_for_py/
|
1
2
3
4
|
<Directory />
AllowOverride none
Require all denied
<
/Directory
>
|
1
2
3
4
5
6
|
<Directory
"/home/xpleaf/Source_Code/cgi_for_py/"
>
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
<
/Directory
>
|
1
|
#AddHandler cgi-script .cgi
|
1
|
AddHandler cgi-script .cgi .py
|
1
2
|
xpleaf@leaf:
/usr/local/apache2/conf
$
sudo
/usr/local/apache2/bin/apachectl
restart
AH00558: httpd: Could not reliably determine the server
's fully qualified domain name, using 127.0.1.1. Set the '
ServerName' directive globally to suppress this message
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
print
"Content-type:text/html"
print
print
'<html>'
print
'<head>'
print
'<title>Hello</title>'
print
'</head>'
print
'<body>'
print
'<h2>Hello Word! This is my first CGI program</h2>'
print
'</body>'
print
'</html>'
|
1
2
3
|
xpleaf@leaf:~
/Source_Code/cgi_for_py
$
chmod
755 hello.py
xpleaf@leaf:~
/Source_Code/cgi_for_py
$
ls
-l hello.py
-rwxr-xr-x 1 xpleaf xpleaf 289 1月 31 16:02 hello.py
|