class Ef_AppSecurity extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
if (!Zend_Auth::getInstance()->getIdentity())
{
$redirect = new Zend_Controller_Action_Helper_Redirector();
$redirect->gotoSimpleAndExit('login', 'auth');
}
}
}
Run Code Online (Sandbox Code Playgroud)
它重定向并更改为新URL,但是在浏览器中它会创建一个重定向循环.我想知道问题是否可能源于apache mod_rewrite设置.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Run Code Online (Sandbox Code Playgroud) 我收到500内部服务器错误,并在其写入的日志文件中:
[Thu Jun 14 16:30:22 2012] [error] [client 127.0.0.1] ImportError: Could not import settings 'mysite.settings' (Is it on sys.path?): No module named mysite.settings
Run Code Online (Sandbox Code Playgroud)
这是我的httpd.conf:
ServerName localhost
<VirtualHost *:80>
ServerAdmin ttt@mysite.com
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/mysite/
LogLevel warn
WSGIDaemonProcess processes=2 maximum-requests=500 threads=1
WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py
Alias /media /var/www/mysite/mysite/static/media/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
wsgi.py:
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Run Code Online (Sandbox Code Playgroud) 我正在尝试将身份验证用于访问apache2中的文档根目录...这是我的配置文件
<VirtualHost *:80>
ServerAdmin webmaster@localhost
AccessFileName .htaccess
DocumentRoot /home/user/workspace
<Directory />
Options FollowSymLinks
AllowOverride None.htaccess
</Directory>
<Directory /home/vishu/workspace>
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
......
......
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
这是/ home/user/workspace文件夹中的.htaccess文件:
<FilesMatch >
.....
</FilesMatch>
AuthType Basic
AuthName "MY ZONE"
#AuthBasicProvider file
AuthUserFile /home/vishu/workspace/passwordfile
AuthGroupFile /dev/null
Require valid-user
.....
...
Run Code Online (Sandbox Code Playgroud)
Apache .htaccess:order not allowed here出错,我从浏览器收到500错误.
我正在尝试在带有rackspace的云服务器中安装wordpress.
但是我缺乏服务器配置(LAMP等)的知识让我做了很多错过配置.
首先,我认为.httaccess是不允许的.第二个更新Wordpress和插件功能不允许第三个可能更多的数字...
让我展示我的虚拟主机文件:
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin adrian@my.com
ServerName my.com
ServerAlias www.my.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html, index.php
DocumentRoot /home/devdreams/domains/my.com/public
# Custom log file locations
LogLevel warn
ErrorLog /home/devdreams/domains/my.com/log/error.log
CustomLog /home/devdreams/domains/my.com/log/access.log combined
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Satisfy all
</Directory>
AccessFileName .htaccess
<Directory /home/devdreams/domains/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all …Run Code Online (Sandbox Code Playgroud) 我有一个apache实例,我有以下内容
WSGIPythonPath /production/somelocation/django12/lib/python2.4/site-packages/
<VirtualHost 192.168.1.1:443>
WSGIScriptAlias / /opt/project.wsgi
.....
Run Code Online (Sandbox Code Playgroud)
我的Django 1.5 app apache配置看起来像,
WSGIPythonPath /production/somelocation/django15/lib/python2.7/site-packages/
<VirtualHost 192.168.1.2:443>
....
WSGIScriptAlias / /opt/project2.wsgi
Run Code Online (Sandbox Code Playgroud)
我的/opt/project.wsgi看起来像
import os
import sys
# django1.2 virtualenv
import site
site.addsitedir("/production/somelocation/django12/lib/python2.4/site-packages")
.....
Run Code Online (Sandbox Code Playgroud)
但是,当我去网站时,我仍然得到我的默认django(1.5)实例.我错过了什么?
当您对.htaccess文件进行更改时,如果出现问题,则会出现"内部服务器错误".这对我没有帮助.我如何找出实际错误是什么?
我在使用默认WebRoot运行Mac OS X 10.9的Mac上启用了apache2服务器/Library/WebServer/Documents.但是,每当我尝试在登录管理员帐户的Finder中添加,编辑或删除该目录中的文件时,无论我尝试什么,文件都会被"锁定",包括chmod"获取信息"中的命令和Mac的"更改权限"菜单窗口.
我想知道是否有人知道允许管理员或任何特定用户帐户编辑目录的方法,而无需向所有用户打开整个文件系统.
谢谢 :)
我最近更新了我的ubuntu,我想在我的Ubuntu 13.10中编程,并且正在设置apache2,每次运行命令时:
sudo a2ensite default
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
错误默认站点不存在
我该如何解决这个问题?
我尝试了所有我在apache文档和stackoverflow和博客上发现的其他sugestions.当我将folloowing行添加到任何配置文件,如/etc/apache2/apache2.conf或/etc/apache2/conf.d/localized-error-pages或/etc/apache2/httpd.conf或/etc/apache2/sites-enabled/000-default:
ErrorDocument 503 "This is an error msg"甚至是HTML消息
ErrorDocument 503 "<h1> This is an error message </h1>
或外部URL重定向ErrorDocument 503 http://www.google.com它的工作原理.
但是,当我尝试内部重定向时,ErrorDocument 503 /ERROR_503.html
或者ErrorDocument 503 /error/ERROR_503.html我得到最后一行的默认消息:
此外,尝试使用ErrorDocument处理请求时遇到503 Service Temporarily Unavailable错误.
我试图把html错误页面放在DocumentRoot var/www,at var/www/error.尝试取消注释所有/etc/apache2/conf.d/localized-error-pages将所有错误设置为具有国际化的自定义页面的文件/usr/share/apache2/error.并且由于此文件中的消息与默认值相同,因此该行
此外,尝试使用ErrorDocument处理请求时遇到503 Service Temporarily Unavailable错误.不再显示了.但是,如果我改变线
`ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var`
Run Code Online (Sandbox Code Playgroud)
在本地化错误页面文件中放置到同一页面的新html,错误返回并且页面未显示.如果我编辑文件HTTP_SERVICE_UNAVAILABLE.html.var,浏览器消息也没有任何变化.
更多信息:我正在使用apache2将端口80上的所有请求通过工作端口重定向到端口8089的tomcat.我的配置文件是https://dl.dropboxusercontent.com/u/1105054/apache.zip
我无法在Ubuntu 14.04上安装apache2.
在执行
sudo apt-get install apache2 得到以下错误: -
The following packages have unmet dependencies:
apache2 : Depends: apache2-bin (= 2.4.7-1ubuntu4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
正如我试过的链接中提到的那样apt-get upgrade -f.
也是输出 dpkg --get-selections | grep -i ^apache2
apache2 deinstall
apache2-doc install
apache2-utils install
apache2.2-common deinstall
Run Code Online (Sandbox Code Playgroud)
输出 apt-mark unhold apache2-bin
apache2-bin was already not hold
输出 apt-cache depends apache2
apache2
Depends: lsb-base
Depends: procps
procps:i386 …Run Code Online (Sandbox Code Playgroud) apache2 ×10
apache ×2
django ×2
mod-wsgi ×2
php ×2
virtualhost ×2
.htaccess ×1
deployment ×1
error-log ×1
html ×1
httpd.conf ×1
lamp ×1
macos ×1
permissions ×1
python ×1
rackspace ×1
redirect ×1
tomcat ×1
ubuntu ×1
ubuntu-13.10 ×1
ubuntu-14.04 ×1
wordpress ×1