Tag Archives: apache
我的httpd.conf模版
ServerRoot “D:/wamp/bin/apache/apache2.2.17″ Listen 80 LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule cgi_module modules/mod_cgi.so … Continue reading
mod_rewrite引起的internal server error
虚拟主机网站根目录下有.htaccess。而虚拟主机的配置是: <VirtualHost *> <Directory “D:/www/xxx”> Options -Indexes FollowSymLinks Allow from all AllowOverride All </Directory> ServerAdmin admin@xxx DocumentRoot “D:/www/xxx” ServerName xxx:80 ServerAlias xxx ErrorLog logs/xxx-error_log </VirtualHost> 因为是AllowOverride是All,可以.htaccess文件重载了这个虚拟主机的配置。然后.htaccess里面有Rewrite模块的指令。而httpd.conf并没有LoadModule mod_rewrite.so。所有出现了500 Internal Server Error。 解决方法要么AllowOverride修改为None,要么删除.htaccess,要么,将mod_rewrite加载进来。
关于apache Alias斜杠/的实验
Alias /icons/ "D:/wamp/bin/apache/Apache2.2.17/icons/" 访问http://localhost/icons/正常,访问http://localhost/icons 404 Alias /icons "D:/wamp/bin/apache/Apache2.2.17/icons" 访问http://localhost/icons自动加上后面的/,正常。 Alias /icons "D:/wamp/bin/apache/Apache2.2.17/icons/" 访问http://localhost/icons自动加上后面的/,正常。 Alias /icons/ "D:/wamp/bin/apache/Apache2.2.17/icons" 访问http://localhost/icons/xx.gif,404,访问http://localhost/icons 404 Not Found。 所以结论是Alias后面的虚拟路径后面不要加多余的/,后面的文件系统路径加不加/就随便你了。
Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration
"Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration". Invalid command 'Header'" appeared because the Apache module mod_headers was not enabled. To enable mod_headers, I had to recompile Apache with the configuration parameter "–enable-headers". If … Continue reading
apache mod_autoindex 详解
mod_autoindex的作用是生成目录索引,类似于unix的ls命令,或者是win32的dir命令 当从服务器请求一个目录的时候,可能来自: mod_dir的DirectoryIndex指定首页 mod_autoindex列目录 这两个模块都是相互独立的,如有需要可以放心的删除、替换。 mod_autoindex模块的指令有:AddAlt,AddAltByEncoding,AddAltByType,AddDescription,AddIcon,AddIconByEncoding, AddIconByType,DefaultIcon,HeaderName,IndexHeadInsert,IndexIgnore,IndexOptions, IndexOrderDefault,IndexStyleSheet,ReadmeName IndexOptions指令 IndexOptions指令的FancyIndexing选项可以让列表头部增加可以让列表按Name,Last modified,Size,Description排序的链接,如图: 默认情况是上图,打开IndexOptions FancyIndexing之后出现了Name,Last modified,Size,Description,点击可以让列表按参数从新排序,参数的定义如下: C=N 根据文件名排序 C=M 根据最后修改时间,然后根据文件名排序 C=S 根据文件大小排序,然后根据文件名排序 C=D 根据描述排序,然后根据文件名排序 O=A 正序排列 O=D 反序排列 F=0 列表简单格式化(没有使用FancyIndexing样式) F=1 FancyIndexing F=2 HTMLTable FancyIndexing组合样式 V=0 VersionSort 关闭 V=1 VersionSort 打开 P=pattern … Continue reading
apache mod_dir 详解
mod_dir指定目录索引文件以及为目录提供”尾斜杠”(trailing slash)重定向。 一个目录的首页可以有两个来源: mod_dir的DirectoryIndex指定首页 mod_autoindex列目录 mod_dir模块有两个指令,DirectoryIndex和DirectorySlash,DirectoryIndex在访问某个目录的时候指定一个“首页”,比如指定如下: DirectoryIndex home.html 在访问http://servername/foo/dirname/的时候会自动寻找http://servername/foo/dirname/home.html,如果没有home.html这个文件,返回404 not found错误,如果启动了mod_autoindex会列出该目录下的所有文件,这个mod_autoindex我们在下面再详细讲解。 DirectoryIndex 可以指定多个首页,优先级是从左到右,比如: DirectoryIndex home.html home2.html 就是先查找home.html,如果没有home.html就查找home2.html。 DirectorySlash决定访问一个不带”尾斜杠”的目录url是否自动加上”尾斜杠”,On是加上,Off是不加。默认是On, DirectorySlash On 访问“http://servername/foo/dirname”,如果dirname是一个目录,就会自动加上“尾斜杠”:“http://servername/foo/dirname/”
httpd.exe: Could not reliably determine the server’s fully qualified domain name , using 192.168.0.100 for ServerName
httpd.exe: Could not reliably determine the server’s fully qualified domain name , using 192.168.0.100 for ServerName ServerName localhost:80 #需要设定一个域名
Apache no listening sockets available, shutting down
no listening sockets available, shutting down Listen 80 #需要设定一个监听端口
Apache Can’t locate API module structure
httpd.exe: Syntax error on line 9 of D:/phpnow/Apache-22/conf/httpd.conf: Can’t locate API module structure `dir_module222′ in file D:/phpnow/Apache-22/modules/ mod_dir.so: No error apache里面的DSO module在LoadModule指令后面的模块名是规定好了的,不能随意命名,所以需要把dir_module222修改为dir_module
apache报错:Invalid command ‘DAV’
在配置svn,重启动apache的时候报错:Invalid command 'DAV', perhaps mis-spelled or defined by a module not included in the server configuration 原因是只加载了mod_dav_svn,而没有加载mod_dav。 这两个module的关系是:You aren't loading mod_dav. mod_dav_svn just implements the back-end, you still need to have mod_dav, which implements the dav protocol.