我做了一个Apache 2.4全新安装。 我想使用Kerberos身份validation。 我编译并安装了mod_auth_kerb模块。 这是我的configuration <location "/restriced/"> SSLRequireSSL AuthName "Kerberos login" AuthType Kerberos KrbMethodNegotiate On KrbMethodK5Passwd Off KrbVerifyKDC Off KrbServiceName HTTPS KrbAuthRealms ******.*** Krb5KeyTab /etc/krb5.keytab KrbLocalUserMapping On require valid-user </location> 当我尝试访问“受限”的位置时,我得到这个错误: [Mon Sep 30 10:21:18.782978 2013] [authz_core:debug] [pid 2219:tid 140278178531072] mod_authz_core.c(802): [client xx.xx.xx.xx:61773] **AH01626: authorization result of Require valid-user : denied (no authenticated user yet)** […]
我有一个VirtualHost,我想有几个子域名。 (为了清楚起见,假设我的域名是example.com ,我只是想通过让foo.example.com工作,并从那里开始构build。) 我发现一个子域与我的框架非侵入性地工作最简单的方法是通过mod_rewrite代理到一个子path。 因此,path将在客户端的URL栏中显示为http://foo.example.com/(无论什么),而他们实际上将被提供http://foo.example.com/foo/(whatever) 。 我设法在我的VirtualHostconfiguration文件中这样做: ServerAlias *.example.com RewriteEngine on RewriteCond %{HTTP_HOST} ^foo\.example\.com [NC] # <— RewriteCond %{REQUEST_URI} !^/foo/.*$ [NC] # AND is implicit with above RewriteRule ^/(.*)$ /foo/$1 [PT] (注意:很难find这个特定的工作组合,特别是在[RewriteRule]中,[PT]似乎是必须的,我无法用我在别处看到的例子[L] 。它不会显示任何东西或进入循环。也有一些浏览器似乎caching响应页面的糟糕的循环,一旦他们得到一个页面重新加载后修复它不会显示它正在工作!任何情况下 – 如果这部分可以做得更好。) 现在我想让什么http://foo.example.com/foo/(无论)提供取决于谁问。 如果请求来自外部,我希望客户端被Apache永久redirect,以便他们在浏览器中获得URL http://foo.example.com/(无论什么) 。 如果它来自mod_rewrite的内部,我想要的是由Web框架处理…这是不知道子域。 是这样的可能吗?
我有一个在AWS上运行的实例,有一个Apache 2,两个命名域和一个ip。 我设法configurationApache和两个域(domain1.com和domain2.com)。 第一个域的docroot指向/var/www/html/vh/domain1.com第二个域的docroot指向/var/www/html/vh/domain2.com 还行吧。 问题是,我想直接在浏览器上使用IP访问/ var / www / html。 当我试图做到这一点,我得到的网站托pipe在domain1.com。 我怎样才能做到这一点?? httpd.conf中的相关行: ServerName 9.9.9.9:80 DocumentRoot "/var/www/html" NameVirtualHost *:80 <VirtualHost 9.9.9.9:80> DocumentRoot /var/www/html </VirtualHost> <VirtualHost 9.9.9.9:80> DocumentRoot /var/www/html/vh/domain1.com ServerName domain1.com DirectoryIndex index.php </VirtualHost> <VirtualHost 9.9.9.9:80> DocumentRoot /var/www/html/vh/domain2.com ServerName domain2.com DirectoryIndex index.php </VirtualHost> 如果我尝试访问: http://9.9.9.9 我得到/var/www/html/vh/domain1.com下的页面,而不是/ var / www / html托pipe的页面 我究竟做错了什么? Thx提前!
我们有IBM HTTP服务器(基于Apache 2.0),并希望将访问日志发送到syslog。 (除了可以工作的错误日志) 我们使用的configuration如下: ErrorLog "|/HTTPServer/bin/rotatelogs /archive/http/error_log.%Y%m%d 86400 | /usr/bin/logger -t httpd -plocal6.err" LogLevel warn LogFormat "%h %{True-Client-IP}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D \"%{Host}i\" %v" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog "|exec /usr/bin/logger -t ptseelm-ax3004 -i -p […]
我目前使用标志-D var_name在某些机器上启动apache,以便我可以使用apache条件块<IfDefine !var_name>来应用某些apache指令。 有没有办法在PHP中检查这些Apache参数?
一个非常常见的解决scheme是执行以下操作: <ifModule mod_headers.c> FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Thu, 01 Jan 1970 00:00:01 GMT" </ifModule> 我希望他们被caching,但我也希望他们在我们重新部署时失效。 我想我需要重新启用ETag,然后当我们重新上传文件“触摸”他们,所以时间戳将读取当前时间,他们会得到一个不同的ETag。 我有点从我从这个答案阅读: https://stackoverflow.com/questions/499966/etag-vs-header-expires 这听起来正确吗?
我遵循这个指南,并试图通过允许foo.dev指向Web文件夹/foo来在OSX上创builddynamic虚拟主机。 我的区别是,我正在使用~/Sites作为我的网页文件夹,而不是像指南中的Mac HD。 它使用dnsmasq,我相信是安装和正常工作。 所以在我的〜/站点文件夹中我有: home sites |-foo |-bar 我的httpd-vhosts.conf如下所示: <Virtualhost *:80> DocumentRoot "/Users/harryg/Sites/home" ServerName home.dev UseCanonicalName Off ErrorLog "logs/home/error.log" <Directory "/Users/harryg/Sites/home"> #Options FollowSymLinks Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Allow from all </Directory> </Virtualhost> <Virtualhost *:80> VirtualDocumentRoot "/Users/harryg/Sites/sites/%1" <Directory "/Users/harryg/Sites/sites/%1"> Options FollowSymLinks #Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Allow from all </Directory> […]
我已经尝试通过从另一台计算机下载.gz文件来安装PHP,将其转移到Linux PC上,然后执行tar,./configure,make和make install过程。 但是我不知道在哪里。 问题: 加载任何PHP页面显示PHP代码,而不是正确的网站。 现在,我尝试了很多事情来得到这个工作,甚至提出了一个问题,但到目前为止,没有运气。 奇怪的是,它在命令行上工作,但浏览器无法显示它。 我唯一一次使用PHP工作的时候是我用yum来获取它的。 所以我想再试一次。 但是,我不确定在我的系统上安装了PHP的情况下执行yum install php的后果。 我试过的东西: 我试图纠正“显示PHP代码”的问题是一个长长的清单,但总结一下: 重新安装PHP(使用make,我现在想要摆脱的安装) configurationhttpd.conf – 具有不同的结果。 出于某种原因,修改httpd.conf文件绝对会破坏Apache。 至于我摆脱现有的PHP的问题: 我试图进入我提取的PHP的东西,并inputmake uninstall ,但只返回No rule to make target 'uninstall'. Stop. No rule to make target 'uninstall'. Stop. 系统: Fedora 19 x86_64 Oracle 11g Apache 2.4.6 我希望有人能够帮助,并提前感谢任何人。 这个问题已经持续太久了。
我已经安装了Mac OSX小牛服务器,我想添加一些function到Apache服务器(gitolite,redmine等)我已经开始更新/Library/Server/Web/Config/apache2的httpd_server_app.conf文件,但不幸的是它已被服务器覆盖到默认值。 也许是因为我已经更新了UI中的某些东西,或者发生了更新……无论如何,我想知道如何以永久和持久的方式更新configuration文件,并且仍然有利于OSX Server UI和/或更新… 我可能错过了这个大牌:“把你自己的东西放在这里:”标签… PS:顺便说一句,我希望修改一些目前的configuration,不仅仅是添加东西…
我试图将所有IP上的端口80的所有请求redirect到端口9000 我有一个服务器在eth0上托pipe几个IP地址。 为了我的问题,让我们说,他们都使用Apache来监听端口9000 只有主IP地址(.106)正常工作并redirectstream量 Chain PREROUTING (policy ACCEPT 2132 packets, 256K bytes) pkts bytes target prot opt in out source destination 128 7236 REDIRECT tcp — eth0 * 0.0.0.0/0 173.234.60.106 tcp dpt:80 redir ports 9000 151 8624 REDIRECT tcp — eth0 * 0.0.0.0/0 173.234.60.107 tcp dpt:80 redir ports 9000 Chain INPUT (policy ACCEPT 0 packets, […]