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.注意看上面的报错提示
xpleaf@leaf:~/下载/apr-util-1.5.4$ make
xpleaf@leaf:~/下载/apr-util-1.5.4$ sudo make install
OK,这样的话,apr-util的安装也完成了。
(3)pcre安装 这不是必需的,前提是你的系统原来已经安装了它的库,如果还没有安装的话,在你编译Apache的时候就会出现下面的错误提示:configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
所以如果你也出现了这样的情况,请先下载安装pcre。 下载地址:http://sourceforge.net/projects/pcre/files/pcre/
这里我下载的版本是:pcre-8.38.tar.gz 安装步骤跟上面的一样,而且这里也不会出现什么问题,直接给出步骤好了:
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
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
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
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
<Directory />
AllowOverride none
Require all denied
</Directory>
将上面的内容全部修改为下面的内容:
<Directory "/home/xpleaf/Source_Code/cgi_for_py/">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
注意这里的目录是修改为前面我们改的:/home/xpleaf/Source_Code/cgi_for_py/ 这样的修改是有原因的,如果没有在这里设置权限,当你在浏览器中访问你的cgi脚本文件时,得到的可能是这样的提示:Forbidden
You don't have permission to access /cgi-bin/hello.py on this server.
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