我在Windows Server 2003上运行Apache/SVN,通过LDAP/Active Directory和平面文件进行身份验证.
除了任何 LDAP用户都可以访问所有内容之外,它工作得很好.我希望能够按用户或组限制SVN存储库.
理想情况下,我会得到这样的东西:
<Location /svn/repo1>
# Restricted to ldap-user1, file-user1, or members of ldap-group1,
# all others denied
</Location>
<Location /svn/repo2>
# Restricted to ldap-user2, file-user2, or members of ldap-group2,
# all others denied
</Location>
Run Code Online (Sandbox Code Playgroud)
真正的诀窍可能是我有混合身份验证:LDAP和文件:
<Location /svn>
DAV svn
SVNParentPath C:/svn_repository
AuthName "Subversion Repository"
AuthType Basic
AuthBasicProvider ldap file
AuthUserFile "svn-users.txt" #file-based, custom users
AuthzLDAPAuthoritative On
AuthLDAPBindDN ldapuseraccount@directory.com
AuthLDAPBindPassword ldappassword
AuthLDAPURL ldap://directory.com:389/cn=Users,dc=directory,dc=com?sAMAccountName?sub?(objectCategory=person)
Require valid-user
</Location>
Run Code Online (Sandbox Code Playgroud)
在我的谷歌搜索中,我看到有些人通过authz像这样拉入文件来实现这一点:
<Location /svn>
...
AuthzSVNAccessFile "conf/svn-authz.txt"
</Location …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Windows(7)x64(使用Apache 2.2)上安装mod_xsendfile Apache模块 - 是的,我从一开始就注定了,我知道:-).显然有:
a)没有用于mod_xsendfile的Win x64二进制文件,只是来自模块网站的Win32二进制文件
b)没有来自ApacheLounge的 apxs的Win x64二进制文件
我已经尝试了平常LoadModule xsendfile_module modules/mod_xsendfile.so但是出现了半明显的错误(httpd: Syntax error on line 127 of C:/Apache/conf/httpd.conf: Cannot load C:/Apache/modules/mod_xsendfile.so into
server: The specified module could not be found.),它不是Win x64兼容的.
问题仍然存在 - 如何为x64构建模块,甚至是可能的?我有VS和任何可能需要的工具.
我只是想看看这是否会提高我的Rails保护附件下载速度 - 目前对简单图像的速度非常可怕.
先感谢您 !
有没有人知道如何使用mod_perl2访问/修改POST请求数据.在GET方法中,可以获取/设置请求QUERY字符串:
$args = $r->args();
$prev_args = $r->args($new_args);
Run Code Online (Sandbox Code Playgroud)
如何在POST方法中获取/设置请求QUERY字符串?
我最近发现CGI脚本几乎可以用任何可以打印到stdout的语言编写.我写了一个小的guile cgi脚本,可以在我的本地apache安装上运行,但不能在我的共享主机上运行:
#!/usr/local/bin/guile -s
!#
(display "Content-Type: text/html")
(newline)
(newline)
(display "hi")
(newline)
Run Code Online (Sandbox Code Playgroud)
当我通过ssh从主机上的shell运行脚本时,这是输出:
$ ./scheme.cgi
Content-Type: text/html
hi
Run Code Online (Sandbox Code Playgroud)
所以,显然我的主机安装了guile.但是,当我尝试在浏览器中访问此文件时,出现"500 Internal Server Error".查看我的错误日志时,我发现我遇到了可怕的"脚本标头过早结束"错误:
[server.com] [Tue Aug 17 00:54:19 2010] [error] [client xx.xx.xx.xxx] (2)No such file or directory:
exec of '/home/www/vhosts/jcw.geekisp.com/cgi-bin/scheme.cgi' failed
[server.com] [Tue Aug 17 00:54:19 2010] [error] [client xx.xx.xx.xxx] Premature end
of script headers: scheme.cgi
Run Code Online (Sandbox Code Playgroud)
因为我在共享主机上,使用mod_lisp或guile的fastcgi实现是不可能的.话虽这么说,这可能是什么问题?类似的cgi脚本我用python,perl,ruby和sh编写的服务器上没有错误.我看到主机上安装了guile 1.8.7,但我的本地机器是最新版本.
我知道这是一个令人难以置信的小众问题,任何帮助将不胜感激!
我遵循Apache Web Policy Agent 的安装指南,但它总是导致Web和应用程序服务器之间的无限重定向循环.Firefox说"页面没有正确重定向",Chrome认为"此网页有重定向循环".该设置是端口80上的Apache 2,带有一个小型演示应用程序和一个Web Policy Agent,以及一个带有OpenAM服务器的端口8080上的Tomcat 7服务器(来自Sun的前OpenSSO):
Live HTTP Header Firefox插件显示策略代理和OpenAM服务器(即Apache和Tomcat服务器)重定向到彼此,尽管服务器正确设置了SSO令牌Cookie.SSO令牌Cookie的名称具有默认值"iPlanetDirectoryPro".知道如何解决问题吗?
我试图将请求限制为内部网站上的API
我设法实现了mod_evasive,以在特定时间内经过特定数量后成功阻止请求。
但这给webUI用户带来了问题
我尝试将mod_evasive的范围限制为api目录,但是Apache2抱怨配置文件无效
<Location /api >
<IfModule mod_evasive20.c>
DOSPageCount 2
DOSSiteCount 50
..
</IfModule>
</Location>
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
例如,httpd.conf中有以下配置:
ProxyPass app http://somehost:someport/App_1
ProxyPassReverse app http://somehost:someport/App_1
Run Code Online (Sandbox Code Playgroud)
现在我应该使用绝对网址将请求从"/ myapp"转发到"/ app":
<Location /myapp >
ProxyPass http://localhost:8080/app
ProxyPassReverse http://localhost:8080/app
</Location>
Run Code Online (Sandbox Code Playgroud)
是否可以在ProxyPass/ProxyPassReverse中使用相对路径?
<Location /myapp >
ProxyPass /app
ProxyPassReverse /app
</Location>
Run Code Online (Sandbox Code Playgroud) 我正在从Apache 1.3迁移到Apache 2.063,并且无法使Apache :: VMonitor正常工作.
我尝试了这样的设置,类似于我在旧的Apache中设置的方式:
<Perl>
use Apache::VMonitor();
$Apache::VMonitor::Config{BLINKING} = 1;
$Apache::VMonitor::Config{refresh} = 0;
$Apache::VMonitor::Config{verbose} = 1;
$Apache::VMonitor::Config{system} = 1;
$Apache::VMonitor::Config{apache} = 1;
$Apache::VMonitor::Config{procs} = 1;
$Apache::VMonitor::Config{mount} = 1;
$Apache::VMonitor::Config{fs_usage} = 1;
$Apache::VMonitor::Config{apache_sort_by} = 'vsize';
$Apache::VMonitor::PROC_REGEX = join "\|", qw(.*)
</Perl>
<Location /vmonitor>
SetHandler perl-script
PerlHandler Apache::VMonitor
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from X.X.X.X ## really a valid IP
</Location>
Run Code Online (Sandbox Code Playgroud)
当我尝试启动我的服务器时,我收到此错误:
ap_scoreboard_image在......不存在
我在Apache :: VMonitor文档中找到了一条说明:
注意对于2.0.53之后的Apache版本(在2.0.54,2.0.55和2.0.58上验证),由于Apache初始化时的更改,在部分和/或PostConfigRequire文件中加载Apache :: VMonitor不起作用记分牌对象.
问题是它没有说我什么时候可以在更高版本的Apache中初始化记分板对象.我试图省略"use"语句并得到此错误:
恐慌:全局破坏期间的del_backref.
*错误代码255
有谁知道如何让这个工作?我并没有停留在使用Apache …
我正在使用Ubuntu 14.04和apache2以及ispconfig 3.就在几个小时前我不小心删了/ var/log/apache2文件夹包含文件,现在我的服务器无法重启apache2,我该如何恢复它们?或者,当重启服务器时,系统会自动创建该日志文件夹和文件吗?
当我重新启动apache2时
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:61
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1
AH00014: Configuration check failed
Action 'configtest' failed.
The Apache error log may have …Run Code Online (Sandbox Code Playgroud) 我有一个问题,尝试使用rest api时会收到响应:“ 从原始地址“ https://kollektivet.app ” 获取到' https://kollektivet.app:8082/api/login/ '的访问权限已被CORS政策阻止:对预检请求的响应未通过访问控制检查:预检请求不允许重定向。”
当我尝试使用任何其他api时,就会发生这种情况。从我所阅读的内容来看,此错误表示我正在尝试重定向,但不是。
后端是Django,看起来像这样:
@csrf_exempt
@api_view(["POST"])
@permission_classes((AllowAny,))
def register(request,):
password = request.data.get("password", "")
email = request.data.get("email", "")
if not email and not password and not email:
return Response(
data={
"message": "username, password and email is required to register a user"
},
status=status.HTTP_400_BAD_REQUEST
)
new_user = User.objects.create_user(
email=email, password=password
)
return Response(status=status.HTTP_201_CREATED)
Run Code Online (Sandbox Code Playgroud)
前端处于反应状态,如下所示:
createUser(event) {
event.preventDefault();
let data = {
name: this.state.name,
password: this.state.password,
repeatPassword: this.state.repeatPassword,
email: this.state.email
};
if (this.state.name !== '' && …Run Code Online (Sandbox Code Playgroud)