Articles of apache 2.2

所有(子)目录的索引是否相同?

我想知道是否有可能编写一些.htaccess页面,使服务器在一个SINGLE目录中使用index.php文件作为我服务器上每个目录/子目录的索引文件,而不是放置完全相同的索引。在200多个目录中的PHP。 如果我的描述不清楚,我的意思是:/files/index.php被用作例如/ files / morefiles的索引,以及所有目录和子目录的索引/ files /,尽pipe这些目录本身没有索引文件。 感谢所有提前。 编辑:PHP文件根据目录生成不同的输出; 具体来说,如果设置了某个cookie,它会列出当前目录的内容。 所以,不幸的是,URL重写将无法正常工作。

在Apache 2.2中的mod perl不parsingperl脚本

我已经使用mod_perl(mod perl v2.0.4 / perl v5.10.1)在windows server 2008 R2上build立了一个新的Apache 2.2.15服务器。 Mod_perl和Perl 5.10已经安装并且没有问题地加载。 但是,尽pipe我的configuration,mod_perl模块无法识别和执行我的.pl文件,而是select打印出perl源代替。 我做错了什么,我怎么让perl处理我的pl脚本,而不是发送给客户端? 我的configuration: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:\Program Files (x86)\AWStats\wwwroot" ServerName analysis.example.com ServerAlias analysis.example.com ErrorLog "logs/analysis.example.com-error.log" CustomLog "logs/analysis.example.com-access.log" common DirectoryIndex index.php index.htm index.html PerlSwitches -T <Directory "C:\Program Files (x86)\AWStats\wwwroot"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <Directory "C:\Program […]

redirectWeb子文件夹根(/文件夹到/)

我试图redirect/文件夹/使用.htaccess但我所得到的是Apache HTTP服务器testing页。 我的根目录如下所示: / .htaccess -/folder -/folder2 -/folder3 我的.htaccess看起来像这样: RewriteEngine On RewriteCond %{REQUEST_URI} !^/folder/ RewriteRule (.*) /folder/$1 我究竟做错了什么? 我检查了我的httpd.conf(我正在运行Centos)和mod_rewrite库正在加载。 作为一个方面说明,我的服务器不是一个万维网服务器,它只是一个虚拟机,所以它的主机名是centosvm。 另外:我的httpd.conf看起来像这样: <VirtualHost *:80> ServerName taa.local DocumentRoot /var/www/html SetEnv APPLICATION_ENV "dev" Alias /taa /var/www/html/taa/public <Directory /var/www/html/taa/public> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>

Apache子域名,文件夹和重写规则

我一直试图设置以下没有成功。 我想/WebContent/<any-folder-name>/html/index.html通过http://<any-folder-name>.homelan.net 。 基本上homelan.net是一个本地域,启用通配符指向相同的IP地址。 我一直在尝试使用不同的RewriteRules,但目前还没有运气。

在雪豹上的Apache的问题

我有点搞砸了我的Mac上的Apache“东西”。 通常当我访问http://localhost/ ,我会看到“It Works!” 但是现在它只是列出了/Library/WebServer/Documents中的目录和文件。 当我尝试用sudo apachectl stop停止/启动/重新启动服务器时,我得到: httpd: Syntax error on line 68 of /etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_disk_cache.so into server: dlopen(/usr/libexec/apache2/mod_disk_cache.so, 10): Symbol not found: _apr_file_info_get$INODE64\n Referenced from: /usr/libexec/apache2/mod_disk_cache.so\n Expected in: flat namespace\n in /usr/libexec/apache2/mod_disk_cache.so 我不想做MacPorts安装,我早些时候尝试过,但是…我只是想通过与通常的./configure,make,make install的源代码来完成。 任何想法如何得到这个工作? 有没有办法完全删除Apache,然后重新安装一个新的版本? 谢谢,Hristo /etc/apache2/httpd.conf的内容与目前一样: # # This is the main Apache HTTP server configuration file. It contains […]

为不同的子目录提供一组特定的错误页面

我目前正在尝试为网站中的单独文件夹设置两组不同的错误文档。 我有一个网站的根目录中的2个文件夹: demo/ live/ 任何在demo文件夹中返回404或403的请求都需要为Apache errordocument加载一组页面,例如。 ErrorDocument 404 /statuses/demo-404.html ErrorDocument 403 /statuses/demo-403.html 而现场需要去类似的名字文件。 ErrorDocument 404 /statuses/live-404.html ErrorDocument 403 /statuses/live-403.html 到目前为止,我已经尝试将.htaccess文件放置在这两个目录中,并将ErrorDocument指令设置指向特定的文件,404工作正常,并引用正确的页面。 但是,当尝试访问demo目录中的禁止文件夹时,403s不工作并且恢复到服务器默认值,日志显示如下: [Wed Jun 16 04:47:44 2010] [crit] [client 115.64.131.144] (13)Permission denied: /home/abstract/public_html/demo/xxx/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable 它是否正确? 将Apache恢复默认,因为它试图寻找一个文件夹中没有权限的htaccess? 为什么它不能通过文件夹树的方式? 我可以做到这一点吗?

将.aspx站点移到nginx,需要将服务器.aspx作为静态文件或重写

我有一个简单的CMS网站,写在asp.net。 我的网站看起来像: www.example.com/ www.example.com/content/index.aspx www.example.com/content/get.aspx?id=234 (loads an article) 它目前使用的是数据库,但是我将把所有的内容转储到文件中,然后我可以根据id = 234的值来获取文件的内容。 我想把这个网站移到我的Ubuntu的nginx服务器上。 我有什么select? build议? 我想保持现在的url结构,我该怎么做? 这将是更容易使用Apache? 注意:为了澄清,我正在远离.net,我只是将内容作为静态文件,我只需要URL来映射没有任何redirect等。

nginx作为前端,apache作为后端的服务器优化?

有没有这种设置的一般优化? 我读了一些关于nginx不使用http中最新的协议,所以有什么东西,我可以调整Apache的? 另外,每个networking服务器或maxconnections的keepalive属性之间是否存在关系? 我不想优化一个正确的方法,让另一个阻止这些优化从任何意义上说。 我从哪说起呢?

如何删除mod_fcgid添加的ServerSignature?

我正在运行Mod_Security,并使用SecServerSignature来自定义Apache返回的Server头。 这部分工作正常,但是我也运行mod_fcgid附加“mod_fcgid / 2.3.5”头。 有什么办法可以把这个关掉吗? ServerSignature off服务器ServerSignature off不起任何作用。 我能够通过更改ServerTokens来消除它,但删除了我添加的定制。

使用Passenger与dynamic大容量虚拟主机/ userdirs

我已经有了一个Apache web服务器设置,它正在为PHP工作。 它没有静态的VirtualHosts设置,并dynamic路由所有请求。 http://example.com/的请求将通过文档根目录/var/www/example.com )提供,并且http://example.com/~user/的请求将从文档根目录/home/user/public_html (mod_userdir)。 后者工作,不pipe域名。 我希望能够使用Phusion Passenger从文档根目录或子目录中为Ruby on Rails应用程序提供服务。 但是,它需要我添加一些行到<VirtualHost>指令,显然不存在。 我更喜欢一个不需要root的解决scheme来部署应用程序,但这并不重要。 如果我具有相同的易用性,我也不介意不使用Passenger的解决scheme。