Articles of apache2

在此服务器上找不到请求的URL /前端/ ru / site / login /

我有一个问题,我的项目工作在Windows(在Apache服务器上)非常好,然后我把我的项目移动到Ubuntu 12.04(apache2服务器),但我的项目不工作。 的Apache2 PHP 5.3.10 mysql 5.5.29-ubuntu0.12.04.2 在萤火虫: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /frontend/ru/site/login/ was not found on this server.</p> <hr> <address>Apache/2.2.22 (Ubuntu) Server at test.local Port 80</address> </body></html> 但是我有URL /frontend/ru/site/login/ 。 main.php: // uncomment the following to define a path alias Yii::setPathOfAlias('site',dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'); // […]

这套django错误是什么意思?

我的Apache2日志正在我的Ubuntu 10.04服务器上吐出这些错误。 当我打到服务器,我得到内部500错误和日志有这样的: [Mon Jul 19 07:40:11 2010] [error] [client 192.168.1.152] File "/usr/local/lib/python2.6/dist-packages/django/utils/dateformat.py", line 281, in format [Mon Jul 19 07:40:11 2010] [error] [client 192.168.1.152] return df.format(format_string) [Mon Jul 19 07:40:11 2010] [error] [client 192.168.1.152] File "/usr/local/lib/python2.6/dist-packages/django/utils/dateformat.py", line 30, in format [Mon Jul 19 07:40:11 2010] [error] [client 192.168.1.152] pieces.append(force_unicode(getattr(self, piece)())) [Mon Jul 19 07:40:11 […]

如何处理所有的请求与一个PHP脚本?

如何用apache2处理一个脚本的所有请求? 没有mods,如果可能的话。

我如何在Ubuntu的Apache Web服务器上运行Django和phpmyadmin

我如何在Apache Web服务器上运行Django和phpmyadmin。 我用本地主机/ phpmyadmin和它的工作,但我configurationDjango本地主机/pipe理后,phpmyadmin不工作,我从Django得到一个错误页面,说该url不是在urls.py。 有没有办法在端口81(httpd.conf)上运行Django,以便它不会与phpmyadmin发生冲突,还是有其他的东西我缺less。我使用mod_python模块。这是我的httpd.conf文件,当我改变位置“/”到位置“/ home / projects /”Phpmyadmin的工作,但Django失败,反之亦然 <location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE hana.settings PythonPath "['/home/projects/', '/home/projects/mysite', '/home/projects/mysite/mysite'] + sys.path" </location> <location "/admin-media"> SetHandler None </location>

Apache – 在2.2 / 2.4中逻辑链接RewriteCond的限制

这些天我读了一篇关于[OR]优先于隐含[AND]的非常有趣的post 。 我真的很喜欢原来的问题以及高度赞赏的答案。 我最近偶然发现了有关这个话题的进一步的问题。 一旦您尝试expression以下内容,问题就会开始: RewriteCond A RewriteCond B RewriteCond C RewriteRule … 与A OR (B AND C) 。 无论你放置[OR] ,它都不起作用: #resolves to (A OR B) AND C RewriteCond A [OR] RewriteCond B RewriteCond C RewriteRule … #resolves to A AND (B OR C) RewriteCond A RewriteCond B [OR] RewriteCond C RewriteRule … #makes no […]

Apache 2.4 – 如何closures整个网站,除了一个子目录?

我们正在使用Apache-2.4提供的新的身份validation和授权框架,并且需要closures整个站点(位置/)以进行未经授权的访问,除了一个子目录(Location / foo),其中可以获得授权cookie。 看起来,AuthMerging是使用的指令,但事情不起作用: <Location /> AuthType form AuthFormProvider foo Session On SessionCookieName ti2f Include conf/sessionpw.conf AuthName TI <RequireAll> Require foo ipaddress Require foo expiration </RequireAll> ErrorDocument 401 /foo/ </Location> <Location /foo> AuthMerging Or Require all granted DirectoryIndex index.php </Location> 不幸的是,访问/ foo仍然被阻止 – 401未经授权。 随着LogLevel的启动,我可以看到mod_authz_corelogging下面的消息: authorization result of Require all granted: granted authorization result of […]

我如何在mod_perl中禁止默认的apache错误文档?

我正在开发一个RESTful API,我写了一个mod_perl2处理程序来处理请求。 我的处理程序通过设置$r->status($http_code)处理错误代码,并return $http_code; 一切都很好,除了一个小问题:当我的http_code是不同于200(例如404),apache附加一个默认的HTML错误文档到我自己生成的响应。 例如: GET /foo 得到: $VAR1 = bless( { 'status' => 404, 'data' => {}, 'message' => 'Resource not found for foo' }, 'My::Response' ); <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /foo was not found on this server.</p> <p>Additionally, a 404 […]

VirtualHost相同的ServerName不同的目录

我有一个正在运行的生产网站分配给主机(redmine应用程序)。 我需要添加一个新的应用程序到一个子目录相同的主机。 这是在主机的基本文件夹中运行的redmine应用程序的当前虚拟主机configuration。 <VirtualHost *:80> ServerName redmine.hostname.com DocumentRoot "C:/BitNami/redmine-2.5.1-1/apps/redmine/htdocs/public/" RewriteEngine On RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA] ProxyPass / balancer://redminecluster ProxyPassReverse / balancer://redminecluster <Proxy balancer://redminecluster> BalancerMember http://127.0.0.1:3001 BalancerMember http://127.0.0.1:3002 </Proxy> </VirtualHost> 所以这个应用程序已经在redmine.hostname.com上运行了。 我想添加我自己的应用程序,我希望它在redmine.hostname.com/myapp/上运行。 无论我做了什么,我都无法做到这一点。 我不能改变redmine的path,我必须添加新的应用程序到同一个虚拟主机。 除了80以外没有任何开放的端口,所以我必须让它运行在redmine.hostname.com/myapp/ 基本上,redmine应用程序必须回复所有不以redmine.hostname.com/myapp/开头的请求。 我的应用程序应该回复所有以redmine.hostname.com/myapp开头的请求。 我应该使用什么设置?

打开RewriteEngine创build403错误 – 如何打开FollowSymLinks?

我正在使用OSX上的内置Apache2。 我将文档根目录移动到桌面上的文件夹,并确保_www和everyone具有读取权限。 它工作正常,很好,PHP的作品,一切工作,直到我只添加一个.htaccess这一行: RewriteEngine on 只要我这样做,目录中的所有文件都是403 Forbidden: Forbidden You don't have permission to access /dir/file.txt on this server. Apache日志显示此错误: [error] [client 127.0.0.1]选项FollowSymLinks或SymLinksIfOwnerMatch已closures,这意味着RewriteRule指令被禁止:/Users/uname/Desktop/localhost/dir/filename.txt 我已经通过httpd.conf ,并确保我已启用FollowSymLinks无济于事: DocumentRoot "/Users/uname/Desktop/localhost" <Directory /> Options FollowSymLinks Options SymLinksIfOwnerMatch AllowOverride All Order allow,deny Allow from all </Directory> <Directory "/Users/uname/Desktop/localhost"> Options FollowSymLinks Options SymLinksIfOwnerMatch Options Indexes MultiViews AllowOverride All Order allow,deny Allow from […]

我怎样才能检查Apache模块版本?

我如何获得debian版本的Apache模块? 我可以通过apache2ctl -M获取加载的模块列表,但是如何获取他们的版本号呢?