我需要能够将我们的网站进入维护模式,除了某些用户允许QA / Dev能够在维护模式下testing对站点/数据库的更改。 问题是每次我们做这个IP的列表都会发生变化,我们不能在每次我们做的时候用不同的IP列表来修改主要的apacheconfiguration文件。 我们可以对apacheconfiguration进行一次性修改,以便支持读入或使用一些其他具有例外列表的文件。 我有什么select提供Apache的IP列表不应该被redirect? 我们添加的.htaccess文件会这样做吗? 关键值对的文件呢? 我看着在Apacheconfiguration中做这样的事情: RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/maintenance.mode -f #RewriteCond %{REMOTE_ADDR} ## check list of exceptions?? RewriteRule !^maintenance/.*$ /maintenance/ [R,L]
我需要重写REQUEST_URI和HTTP_HOST,但是当我实现这个时,我得到一个redirect错误: # Capture mysite.com/pages/123 RewriteCond %{REQUEST_URI} ^/pages/[0-9]+/?$ RewriteRule ^/pages/([0-9]+)/?$ /home/mysite/www/pages.php?id=$1 # Now capture the subdomain RewriteCond %{HTTP_HOST} ^([a-z0-9]+).mysite.com RewriteRule (.*) $1&subdomain=%1 [L,QSA] 我在这里做错了什么? 谢谢
我试图在本地域的一部分上实现HTTP摘要authentication。 我在Mac OSX Lion上使用MAMP。 MAMP使用端口8888,所以我可以导航到我的域在http://localhost:8888/myDomain或http://127.0.0.1:8888/myDomain 。 这两个工作正常的域的未经身份validation的部分。 但是,如果我导航到受保护的地址,会发生一些奇怪的事情。 如果我使用本地主机,那么摘要authentication工作绝对好,但如果我使用127.0.0.1,则authentication保持失败。 我一直没有能够看到任何有关的我的Apache日志文件或我的PHP日志文件,可能会build议任何事情。 我检查了我的.htaccess文件和httpd.conf文件,并再次看不到任何看起来可能会导致问题的东西。 任何人都可以提出任何我可以尝试的地方,或者我应该去尝试和诊断问题? 我一直在运行查尔斯代理来帮助debugginghttp请求,但查尔斯是否正在运行似乎并不重要,我仍然遇到同样的问题。 编辑:这是我的.htaccess <IfModule mod_rewrite.c> # Make sure directory listing is disabled Options +FollowSymLinks -Indexes RewriteEngine on # NOTICE: If you get a 404 play with combinations of the following commented out lines #AllowOverride All #RewriteBase /wherever/pyro/is # Restrict your site to only one […]
我正在开发本地计算机上的一个站点,并希望将现有站点的子域指向我的本地主机的子域。 一个具体的例子: 我有一个正常运行Apache 80端口,虚拟主机端口8081.我想指向http://dev.google.com到我的虚拟主机。 我已经尝试将其添加到主机文件,但端口不工作。 我正在使用Windows 7 x64
我意识到在serverfault上这个问题有很多不同的变化,但是我没有把结果合并来匹配我们的情况。 我们有一个运行Apache 2.2的CentOS 6.2 web服务器,它托pipe着几十个具有相同父域的网站 – 例如cat.example.com,bat.example.com,rat.example.com 我们希望将https添加到这些子域的一些(但不是全部)。 https的子域将永久运行https。 例如, http://bat.example.com会redirect到https://bat.example.com 我们已经为SSL购买了Comodo多域SSL证书许可证,允许我们为多个域创build证书。 Web服务器只有一个面向公众的IP。 我们如何设置Apache来做到这一点? 如果bat.example.com的httpd.conf中的虚拟主机条目是: <VirtualHost *:80> ServerName bat.example.com DocumentRoot /var/www/sites/bat ErrorLog logs/bat-error_log CustomLog logs/bat-access_log common </VirtualHost> 在bat.example.com上启用SSL需要做什么修改,并确保http://bat.example.com仍然有效,但redirect到https://bat.example.com ?
我在OS X 10.7.4上使用Apache(与Zend Server捆绑在一起)获得HTTP 403,权限错误13(文件系统?)。 [Thu May 17 16:40:58 2012] [error] [client ::1] (13)Permission denied: access to / denied 这是我在httpd-vhosts.conf中的configuration <VirtualHost *:81> DocumentRoot "/Users/shamil/Documents/Sites/shamil_blog" ServerName blog.shamil.local ServerAlias blog.shamil.local ErrorLog "logs/shamil_blog-error_log" CustomLog "logs/shamil_blog-access_log" common DirectoryIndex index.php <Directory /Users/shamil/Documents/Sites/shamil_blog> Options +Indexes +FollowSymLinks +ExecCGI DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 我已经在shamil_blog文件夹上设置了适当的权限: drwxrwxrwx 25 […]
我想通过mod_jk(同一台机器)将Apache连接到tomcat。 tomcat中的ajp连接器正在侦听端口8009,工作者设置为: worker.worker1.port=8009 worker.worker1.host=localhost 但是,连接失败,这里是mod_jkdebugging日志: [debug] wc_get_name_for_type::jk_worker.c (292): Found worker type 'ajp13' [debug] init_ws_service::mod_jk.c (1097): Service protocol=HTTP/1.1 method=GET ssl=false host=(null) addr=127.0.0.1 name=localhost port=80 auth=(null) user=(null) laddr=127.0.0.1 raddr=127.0.0.1 uri=/share [debug] ajp_get_endpoint::jk_ajp_common.c (3154): acquired connection pool slot=0 after 0 retries [debug] ajp_marshal_into_msgb::jk_ajp_common.c (626): ajp marshaling done [debug] ajp_service::jk_ajp_common.c (2449): processing worker1 with 2 retries [debug] ajp_send_request::jk_ajp_common.c (1623): […]
我正在寻找一个简单的Apache控制面板的networking服务器,使我能够: 添加用户FTP帐户,并将其匹配到单个域Web服务器上的文件夹 改进:Mysql账号pipe理 改进:Tomcat支持 没有名称服务器,没有电子邮件帐户pipe理(至less可以禁用!)。
我正在使用Apache和mod_proxy通过HTTP提供对Monit GUI的访问。 到目前为止,我的configuration如下: ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass /monit http://localhost:2812/ ProxyPassReverse /monit http://localhost:2812/ 当人们去http://mywebsite/monit他们得到Monit主页。 然而,由Monit返回的链接有一个绝对path,它打破了仅适用于以/monit开头的path的代理。 我可以为http://monit.mywebsite (例如http://monit.mywebsite )创build一个单独的vhost来解决这个问题,但是想知道是否有另一个解决scheme。 问题1:有没有办法让Apache重写HTML代码中的链接,以便在ProxyPass和ProxyPassReverse指令中定义任何path? 问题2:如果上述不可能,你会看到另一个解决scheme,而不是我提到的单独的vhost ?
这是我的.htaccess文件的内容: Options MultiViews Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.lventas.com$ [NC] RewriteRule ^(.*)$ http://lventas.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ http://lventas.com/negocio/$1 [L,QSA] ErrorDocument 404 http://www.lventas.com/404.php RewriteOptions Inherit 当到达根文件夹时,它不应该什么都不做,但它仍然redirect到: http://lventas.com/negocio/default.asp 什么是'default.asp'? 为什么要在那里?