apache 2.4.1 配置cgi、webdav、SSI支持
2012-03-27 10:08
656 查看
apache 2.4.1 默认安装目录/usr/local/apache2
一、配置webdav
1.httpd.conf中user group 改daemon 为apache或其他非root用户组,没有此用户需要新建。
2.httpd.conf中包含httpd-dav.conf:Include conf/extra/httpd-dav.conf。
3.httpd-dav.conf中配置webdav、var的目录:
1)新建目录webdav、var
2)配置httpd-dav.conf
4.设置webdav的目录为apache.apache拥有。
并设置var的目录为apache.apache用户组拥有。使服务器用户组拥有webdav的权限,以便操作webdav。
5.httpd.conf中添加必要模块支持:
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
6.验证。
1)在linux平台安装cadaver命令行的webdav客户端。在终端键入cadaver
http://ip/webdav。
2)windows平台上,新建网上邻居,输入http://ip/webdav,如果可以链接到,则可以建立一个链接,连接成功后自动打开webdav的目录。
7.未配置用户登陆等。
二、配置cgi支持
1.httpd.conf中:LoadModule cgid_module modules/mod_cgid.so
2.注意cgi-bin目录下的printenv、test-cgi并不能立即运行。查看文件内容说明。或另写cgi文件测试。
3.注意该cgi文件的执行权限,一定要是apache服务器用户组拥有执行权限。否则可能提示 server internal 错误。
4.验证,以hello.c为例,编译后为hello。
在浏览器上输入http://192.168.1.254/cgi-bin/hello,会看到显示效果。
三、配置SSI支持
httpd.conf文件下:
1)添加LoadModule include_module modules/mod_include.so
2)修改Options Indexes FollowSymLinks 为:
Options Indexes FollowSymLinks Includes
并将
#AddType text/html .shtml 或#AddHandler server-parsed .shtml(二选其一)
#AddOutputFilter INCLUDES .shtml
之前的#去掉。
3)测试:新建hello.shtml,放于DocumentRoot内容如下:
在浏览器网页运行,会显示hello !和当前时间。否则只显示hello !
一、配置webdav
1.httpd.conf中user group 改daemon 为apache或其他非root用户组,没有此用户需要新建。
2.httpd.conf中包含httpd-dav.conf:Include conf/extra/httpd-dav.conf。
3.httpd-dav.conf中配置webdav、var的目录:
1)新建目录webdav、var
2)配置httpd-dav.conf
DavLockDB "/usr/local/apache2/var/DavLock" Alias /webdav "/usr/local/apache2/webdav" <Directory "/usr/local/apache2/webdav"> Dav On Order Allow,Deny Allow from all <RequireAny> Require all granted </RequireAny> </Directory>
4.设置webdav的目录为apache.apache拥有。
chown apache.apache /usr/local/apache2/webdav
并设置var的目录为apache.apache用户组拥有。使服务器用户组拥有webdav的权限,以便操作webdav。
5.httpd.conf中添加必要模块支持:
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
6.验证。
1)在linux平台安装cadaver命令行的webdav客户端。在终端键入cadaver
http://ip/webdav。
2)windows平台上,新建网上邻居,输入http://ip/webdav,如果可以链接到,则可以建立一个链接,连接成功后自动打开webdav的目录。
7.未配置用户登陆等。
二、配置cgi支持
1.httpd.conf中:LoadModule cgid_module modules/mod_cgid.so
2.注意cgi-bin目录下的printenv、test-cgi并不能立即运行。查看文件内容说明。或另写cgi文件测试。
3.注意该cgi文件的执行权限,一定要是apache服务器用户组拥有执行权限。否则可能提示 server internal 错误。
4.验证,以hello.c为例,编译后为hello。
在浏览器上输入http://192.168.1.254/cgi-bin/hello,会看到显示效果。
三、配置SSI支持
httpd.conf文件下:
1)添加LoadModule include_module modules/mod_include.so
2)修改Options Indexes FollowSymLinks 为:
Options Indexes FollowSymLinks Includes
并将
#AddType text/html .shtml 或#AddHandler server-parsed .shtml(二选其一)
#AddOutputFilter INCLUDES .shtml
之前的#去掉。
3)测试:新建hello.shtml,放于DocumentRoot内容如下:
<html> <head>hello !</head> <body> <!--#echo var="DATE_LOCAL"--> <body> </html>
在浏览器网页运行,会显示hello !和当前时间。否则只显示hello !
相关文章推荐
- 让Apache支持cgi、SSI、shtml的配置方法
- 配置APACHE支持CGI(WIN环境)
- 在Windows的Apache服务器上配置对PHP和CGI的支持
- apache服务器ssi支持配置
- Apache配置解析SHTML支持(SSI)
- apache配置ssi支持shtml
- 配置Apache对CGI的支持
- Apache下开启SSI配置使shtml支持include包含
- apache中配置php支持模块模式、cgi模式和fastcgi模式
- apache中配置php支持模块模式、cgi模式和fastcgi模式的实验
- 一份简化的Apache httpd.conf文件,包含CGI、SSI和PHP支持
- apache中配置php支持模块模式、cgi模式和fastcgi模式的实验
- apache和nginx支持SSI配置
- apache中配置php支持模块模式、cgi模式和fastcgi模式的实验
- apache和nginx支持SSI配置
- 配置Apache对CGI的支持
- apache中配置php支持模块模式、cgi模式和fastcgi模式
- 配置apache支持SSI
- apache中配置php支持模块模式、cgi模式和fastcgi模式的实验
- apache中配置php支持模块模式、cgi模式和fastcgi模式