我想让Apache在我的“项目”目录中运行一个cgi可执行文件。 它应该在以下位置响应HTTP请求: localhost/packages localhost/packages/ 但是,它不应该响应HTTP请求 localhost/packages/PackageName localhost/packages/PackageName/ localhost/packages/PackageName/more/stuff 为此,我创build了一个Apacheconfiguration文件,其中包含: ScriptAlias /doc_cgi/ /long/path/to/cgi/DocCGI.haskell/ RewriteEngine On RewriteRule ^/packages/?$ /doc_cgi/packages/ [L,PT] <Directory "/long/path/to/cgi/"> Order deny,allow Allow from all AddHandler cgi-script .haskell Options +ExecCGI </Directory> 正如我所预料的那样,在向localhost / doc_cgi /发送http请求时,会调用cgi程序。 但是,当我提出请求时,重写规则似乎没有被触发 localhost/packages localhost/packages/ 因为我得到404错误,日志说: [Wed Jul 20 12:29:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/packages 为了完整起见,下面是configuration文件的相关部分,它定义了我如何处理对localhost / packages […]
我正在更新我的htaccess文件来控制一个正在创build的子域。 我遇到了一些问题。 首先,我build立了http://m.domain.com/这个域名,并指向http://www.domain.com/mobile.php/mobile 我希望这样的工作,因为我不想经过一个大的过程重构当前设置的URL路由,并修复它,这样会更容易。 我也想这个在我的开发机器上本地工作。 所以下面的url也适用: http : //local.m.domain.com和本地网站redirect到http://local.domain.com/mobile.php/mobile 这意味着,如果我传递参数后,说:: http://m.domain.com/page它会然后路由到页面http://www.domain.com/mobile.php/mobile/page 到目前为止,我有,但这只是下载一个PHP文件,而不是路由任何页面。 RewriteCond %{HTTP_HOST} (^local\.|^)m\.domain\.com\.au$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ mobile.php\/mobile$1 [QSA] 我知道,本地或“没有”select器的正则expression式是懒惰的,但我不认为这是什么杀死它。 当然,我可能是错的。 任何提示或build议将感激地接受。
在大多数情况下,我们会有 1)只有一个定义types为'lb'的负载(Loadbalancer) 2)我们将有多个成员工(定义目标应用服务器实例) 3)我们将这些目标工作者与定义的负载均衡器进行映射 属性worker..balance_workers = worker1,worker2 以下是查询。 1)是否有可能在同一个modjkconfiguration文件中定义多个负载均衡器,并且有不同的目标worker与这些worker相关联。 2)是否可以在应用程序级定义负载均衡机制(对于不同types的应用程序(具有不同的应用程序上下文,但在同一个工作节点上运行),使用不同的lb因子方法)?如果可能,我们如何configuration? 3)有什么办法可以设置超时的请求,可能需要更长的时间间隔发送回应?
我有前面apache2和后端tomcat6与apache lenya。 代理工作正常,但我想caching图像。 这是我的简单configuration: ProxyPass / http://192.168.0.82:8888/ ProxyPassReverse / http://192.168.0.82:8888/ RewriteRule ^/$ index.html [R] RewriteRule ^/default/live/(.*)$ $1 [R,L] RewriteRule ^/(.*) http://192.168.0.82:8888/default/live/$1 [P] ProxyRequests Off RewriteEngine On 我试图用这种方式caching它: <IfModule mod_disk_cache.c> CacheEnable disk / CacheRoot "/var/cache/mod_proxy" CacheRoot /home/apache2/cache CacheDefaultExpire 60 CacheMaxExpire 3600 </IfModule> 但是我什么也没得到 我甚至试过这种方式: <IfModule mod_mem_cache.c> CacheEnable mem / MCacheMaxObjectSize 1024000 MCacheSize 102400 </IfModule> 再次没有结果。 启用了mod_mem_cache和mod_disk_cache。 […]
首先,我的服务器configuration是openSUSE 11.4,我的web服务器是apache 2.2。 我想更改Web服务器的错误文件,但是我不能让Apache知道错误文件与每个虚拟主机都不相关! 我编辑了/ etc / apache中的error.conf文件,并删除了关于本地化的所有废话(不关心),并添加: ErrorDocument 404 /srv/www/errors/404.html 重新启动Apache,然后尝试访问不存在的内容。 输出是: 未find在此服务器上未find请求的URL / notadocument。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。 我检查错误日志,看看这个: [Mon Aug 01 15:34:36 2011] [error] [client xxxx] File does not exist: /home/andreas/www/notadocument [Mon Aug 01 15:34:36 2011] [error] [client xxxx] File does not exist: /home/andreas/www/srv 正如你所看到的,Apache试图查看我的虚拟主机的目录,而不是在服务器的根目录! 我该如何解决?
我正在尝试使用Apache 2创build自动子域(在Ubuntu上运行) 我已经使用VirtualDocumentRoot指令来执行文档根目录的初始声明,在我的虚拟主机文件中包含以下内容: <VirtualHost *:80> VirtualDocumentRoot /var/www/dev/branches/%1/public/ ServerAlias *.dev.example.com <Directory /> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 这对于第一部分来说很好,所以对foo.dev.example.com的请求具有/var/www/dev/branches/foo/public的文档根目录,这很好。 问题 唉,公共文件夹中的*.htaccess文件似乎没有工作。 所有请求都应该通过公用文件夹中的index.php发送,如.htaccess文件所示: Options -Indexes <IfModule mod_rewrite.c> RewriteEngine on # redirects requests to index.php where no file or directory exists RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php […]
我设置了nginx反向代理向Apache服务器发送请求,为每个传入的请求提供服务,以便静态内容自己处理,并将dynamic发送到在同一台计算机上运行的Apache。 但是完成设置后,下载速度过慢,下载静态内容需要很长时间。 我能做些什么来改善呢?
我目前正在我的机器上运行CentOS 5.5,并且正在尝试使用Django,MySQL和Apache来设置构build服务器。 我基本上没有任何经验,而且每次遇到新的错误时,我一直在Google上进行研究。 到目前为止,这是一个决定性的结果,但现在我陷入了最后一步。 # service httpd start Starting httpd: httpd: apr_sockaddr_info_get() failed for jmaxime-linux httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ OK ] # service mysqld start Starting MySQL: : [ OK ] # service buildserverd start Starting buildserverd : [ OK ] 所以显然一切顺利。 但是,我得到以下几点: […]
我用ubuntu设置amazon ec2实例上的apache 我使用文档根目录设置到/mnt/www/domain.com/htdocs 当任何文件被访问时,我在apache日志上得到这些错误。 [Fri Aug 12 12:26:46 2011] [error] [client xxxxxxx] File does not exist: /mnt [Fri Aug 12 12:26:46 2011] [error] [client xxxxxxx] File does not exist: /mnt [Fri Aug 12 12:26:47 2011] [error] [client xxxxxxx] File does not exist: /mnt fstab file: /dev/xvda2 /mnt auto defaults,nobootwait,comment=cloudconfig 0 2 /dev/xvda3 none swap sw,comment=cloudconfig […]
这很奇怪! 运行Debian Lenny 32bit。 在开发机器上运行Apache / MySql 5.5.15 / Mongo和Memcached。 这是在Mysql中运行复杂查询之后发生的第二次。 Mongo第一次参与,所以我知道现在不是罪魁祸首。 这一次,我终止了查询,并且apache2永久停机。 我停止了机器上的所有进程,并重新启动了所有进程,但无法访问服务器。 Apache使用ssl在更高的端口上build立。 即使重新启动也没有办法! 有人修复了一次服务器,但我似乎无法find他们…长话短说。 试图访问本地通过本地l got – 无法连接远程主机。 显然,Apache正在运行…. root 3277 0.0 0.8 66932 8816 ? Ss 19:30 0:00 /usr/sbin/apache2 -k start www-data 3283 0.0 0.4 66932 4408 ? S 19:30 0:00 /usr/sbin/apache2 -k start www-data 3284 0.0 0.4 66932 4408 ? […]