Linux 上安装apache2

Linux 下安装apache2

1 下载httpd-2.2.17.tar.gz

2  tar -zxvf httpd-2.2.17.tar.gz ,//解压到文件夹httpd-2.2.17

3  cd httpd-2.2.17

./configure  --prefix=/usr/local/apache --enable-mods-shared=most

第一个参数指定安装目录,第二个参数生成.so,如果没加,在/usr/local/apache/modules 里就没有so文件.

参数也可以写成--enable-mods-shared=all

4 make

5 make install



Finished

--------------------------------------------------------

如果出现错误

Invalid command 'Order', perhaps misspelled or defined by a module not included
in the server configuration
是因为
LoadModule authz_host_module modules/mod_authz_host.so
这个模块没有加载,在配置文件中增加即可