我有一个小的Apache网站,我已经成功地使用mod_authz_ldap实现了基本的LDAPauthentication。 但是,我在尝试实现两个级别的连续authentication时遇到问题。 一旦一个有效的用户被authentication一次,他们从来没有被提示进行二次authentication,这对于该网站的特定部分应该是必需的。 也就是说,所有有效的用户都可以login,但是只有这些用户的一部分访问站点的部分内容时才会重新进行身份validation。 例如,我要求访问example.com的每个人都被authentication为有效的LDAP用户。 然后我在example.com/websvn上有一个subversion版本库,我只想限制为“开发”组,这是有效用户的一个子集。 我的问题是,一旦用户在example.com上被成功validation为有效,那么当他们导航到example.com/websvn时,他们永远不会被重新提示为“开发”用户进行身份validation。 即使有效用户确实不在开发组中,也会发生这种情况。 我可以通过直接连接到example.com/websvn来testingrepo身份validation,但是当我第一次在example.com进行身份validation时,然后访问example.com/websvn,我被授予了访问权限,不会提示input密码。 我如何正确实施这样的两阶段authentication? 我希望所有有效的用户访问主站点,但只有开发用户才能访问websvn。 所以有效的用户必须重新validation以检查他们是否在开发组中。 谢谢!
我正在尝试实现虚拟子域,因为我的托pipe服务提供商已经设置了我可以拥有的子域数量的限制! 我已经有一个通配符的DNS条目,所以所有子域都被接受并发送到我的域的根目录。 这是我已经把.htaccess处理redirect: RewriteEngine on RewriteCond %{HTTP_HOST} !^(www|admin).* [NC] RewriteCond %{HTTP_HOST} ^([a-zA-Z0-9]+)\.domain\.-com RewriteCond /home/username/public_html/subdomain/%1 -d RewriteRule ^(.*) /home/username/public_html/subdomain/%1/$1 问题是在实际redirect的最后一行,服务器显示500(内部服务器错误),但Apache错误日志不会扩大错误。 如果我把这样的东西放在它的位置: RewriteRule ^(.*) index.php?path=/home/username/public_html/subdomain/%1/$1 它工作正常…而path是正确的文件path。
我在一个Apache服务器上有一个页面site.shtml ,其中我想包含几个CGI脚本,如下所示: <p><pre><!–#include virtual="files/testfile" –></pre></p> <p><pre><!–#include virtual="cgi-bin/randhtml.cgi"–></pre></p> <p><pre><!–#include virtual="cgi-bin/echo.cgi" –></pre></p> <p><pre><!–#include virtual="echo.cgi" –></pre></p> <p><pre><!–#include virtual="cgi-bin/echo.cgi?test" –></pre></p> 在这种情况下, files/testfile是一个文本文件, cgi-bin/randhtml.cgi是一个预先安装的CGI可执行文件, echo.cgi两个实例都是脚本: #!/bin/sh echo $0; echo $*; 所有脚本的权限设置为755,并可以从shell执行,其行为如预期(随机输出或回显参数)。 当我尝试加载网页,文件和随机脚本正确执行,我得到了预期的输出。 回声脚本不是,我在页面中得到了一些错误: This is a test text file. random An error occurred while loading this page. An error occurred while loading this page. An error occurred while loading this […]
我目前在我的.htaccess文件中定义了一个ErrorDocument指令: ErrorDocument 404 /site/error.php 现在,如果我去我的网站上这样一个不存在的页面,它工作正常: http://mysite.com/p 但是,如果我尝试去一个不存在的目录,该指令不起作用 http://mysite.com/random/hello 试图find该文件: http://mysite.com/random/site/error.php 这当然不存在。 我在网上search和所有来源表明上面的第二个例子应该去正确的文件(因为领导/在指令使它相对于Web根),但是这显然不是这种情况。 我在Ubuntu上运行,谢谢!
由于遗留的原因,我有一个主要生活在一个子目录中的wordpress网站: http : //www.zmxmusic.com/site 。 不过,它也在http://www.zmxmusic.com上提供主页。 我没有访问当前使用的Apacheconfiguration,我很难在新的服务器上复制这种行为。 wordpress网站位于/ srv / zmx / wp / site的文件系统中,wordpress的主页和siteurl被定义为http://www.zmxmusic.com/site 。 我有这在Apacheconfiguration: <VirtualHost *:80> ServerName www.zmxmusic.com ServerAlias …omitted… DocumentRoot /srv/zmx/wp <Directory /srv/zmx/wp> Options FollowSymLinks AllowOverride FileInfo Options Order allow,deny Allow from all </Directory> LogLevel info ErrorLog /var/log/apache2/zmx_app-error.log CustomLog /var/log/apache2/zmx_app-access.log combined RewriteEngine On Options +FollowSymlinks RewriteCond %{REQUEST_URI} !^/(site/|index\.php) RewriteCond %{SCRIPT_FILENAME} !-f […]
我用suPHPconfiguration了我的CentOS安装。 它工作得很好。 但是,当我安装PHPMyAdmin我得到一个权限问题。 因为PHPMyAdmin位于/usr/share/phpmyadmin 。 我不想为每个域使用额外的虚拟主机。 我想在每个域上使用别名到/phpmyadmin 。 我必须做些什么才能使其工作?
我的Apache Webserver有问题,我有两个环境:开发和生产。 两者都具有相同的configuration,但第一个发送的HTML完全按照他们已经创build,第二个不发送完全相同的文件。 他们省略了空格,注释和其他字符,对于浏览器不关心,但是如果我的应用程序从这个文件生成哈希值,而且Apache会更改文件,哈希将不会相同。 我一直在寻找差异,但我什么也没有出现。 任何build议? 我的apache2configuration <VirtualHost *:80> ServerName XXX ServerAlias XXX XX.XX.XX.XX DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/api-error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel info CustomLog […]
我已经从我的debian挤压盒上的icinga自己的回购安装了icinga,但现在我不知道如何改变当前的configuration: # apache configuration for icinga ScriptAlias /cgi-bin/icinga /usr/lib/cgi-bin/icinga ScriptAlias /icinga/cgi-bin /usr/lib/cgi-bin/icinga # Where the stylesheets (config files) reside Alias /icinga/stylesheets /etc/icinga/stylesheets # Where the HTML pages live Alias /icinga /usr/share/icinga/htdocs <DirectoryMatch (/usr/share/icinga/htdocs|/usr/lib/cgi- bin/icinga|/etc/icinga/stylesheets)> Options FollowSymLinks DirectoryIndex index.html AllowOverride AuthConfig #Order Deny, Allow Deny from all #Allow From 10.42.0.0/24 AuthName "Icinga Access" AuthType Basic AuthUserFile […]
我的apache主服务器监听备用端口(端口8080)上的HTTP请求,但我想让用户键入我的域名(example.com),而不必指定端口。 到目前为止,我已经通过我的DNS提供商完成了这一任务,他将任何请求redirect到www.example.com或example.com到http://123.456.789.001:8080 这是一个问题,因为虽然它起作用,但是用户在他们的URL栏中得到了一个丑陋的数字。 我想要做的是将123.456.789.001:8080重写为example.com 我已经尝试阅读http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html ,但我不是URL写作的专家,我已经提出了(哪些显然不工作)是: RewriteEngine on RewriteCond %{HTTP_HOST} =123.456.789.001 RewriteRule ^(.*) example.com/$1 我放在我的httpd.conf文件中。
我有以下.htaccess文件: RewriteEngine on RewriteBase / RewriteRule ^(/?)dir/?$ $1dir/subdir [L] RewriteRule ^(/?)subdir2/?$ $1dir/subdir/subdir2 [L] redirect工作正常,如果我键入域的IP,但在域名/目录input根本不redirect我,而是显示目录的内容。 另一个问题:正如我所说的,redirectIP工作正常。 不过,虽然没有设置“R”标志,但是url地址会改变。 IP / dir变成IP / dir / subdir。 为什么? 编辑(11:20 GMT + 1):不太确定是否有任何相关性,但在今天之前,服务器没有一个域。 我刚刚买了一个域名,并设置了所有指向服务器的名称服务器。 由于我可以访问该页面,它显示了/ dir文件夹的内容,我假设我没有搞砸任何东西。 编辑(12:51 GMT + 1):输出从apachectl -S: apache2: Could not reliably determine the server's fully qualified domain name, using 0.0.10.188 for ServerName VirtualHost configuration: wildcard NameVirtualHosts […]