小编Dav*_*ave的帖子

用于通配符子域和静态子域的虚拟主机

我有一个奇怪的情况下,我想有网址app1.example.com,example.com并且*.example.com 都使用不同的虚拟主机.这就是我所拥有的(不包括example.com因为它只是让它变得更加混乱).

<VirtualHost *>
  ServerName app1.example.com
  ServerAlias app1.example.com

  DocumentRoot = /var/www/app1
  # Other configuration for this app here

</VirtualHost>

<VirtualHost *>
  ServerName wildcard.example.com
  ServerAlias *.example.com

  DocumentRoot = /var/www/wildcard
  # other configuration for this app here

</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

问题是他们发生冲突.无论哪一个列出首先胜出.如何托管通配符虚拟主机和特定主机?

注意:我不只是更改DocumentRoot配置,因此使用mod_rewrite更改DocumentRoot变量不会修复它.

apache subdomain wildcard-subdomain virtualhost

70
推荐指数
2
解决办法
10万
查看次数

Apache端口代理

我有一个非Apache服务器侦听端口8001和Apache侦听端口80.我希望某个虚拟域实际上由非Apache服务器通过端口80提供服务.

例:

<VirtualHost *:80>
  Servername example.com

  # Forward this on to the server on port 8001
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

我以为我可以用mod_proxy和ProxyPass这样做.

ProxyPass * http://www.example.com:8001/
Run Code Online (Sandbox Code Playgroud)

但这不起作用.

apache2 apache-config

17
推荐指数
2
解决办法
4万
查看次数

WSlI中的httplib CannotSendRequest错误

我和Django使用了两个不同的python oauth库来通过twitter进行身份验证.使用WSGI进行apache设置.当我重新启动服务器时,一切都运行良好大约10分钟,然后httplib似乎锁定(请参阅以下错误).

我只运行了1个进程和1个WSGI线程,但这似乎没有任何区别.

我无法弄清楚为什么它会锁定并给出这个CannotSendRequest错误.我花了很多时间来解决这个令人沮丧的问题.任何有关它的提示/建议将不胜感激.

File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 92, in get_response
  response = callback(request, *callback_args, **callback_kwargs)

File "mypath/auth/decorators.py", line 9, in decorated
  return f(*args, **kwargs)

File "mypath/auth/views.py", line 30, in login
  token = get_unauthorized_token()

File "/root/storm/eye/auth/utils.py", line 49, in get_unauthorized_token
  return oauth.OAuthToken.from_string(oauth_response(req))

File "mypath/auth/utils.py", line 41, in oauth_response
  connection().request(req.http_method, req.to_url())

File "/usr/lib/python2.5/httplib.py", line 866, in request
  self._send_request(method, url, body, headers)

File "/usr/lib/python2.5/httplib.py", line 883, in _send_request
  self.putrequest(method, url, **skips)

File "/usr/lib/python2.5/httplib.py", line 770, in putrequest
  raise CannotSendRequest()
Run Code Online (Sandbox Code Playgroud)

CannotSendRequest

python twitter wsgi oauth httplib

16
推荐指数
1
解决办法
1万
查看次数

JSONP Long Polling总是加载

我正在使用JSONP进行长轮询,并且firefox不断弹出"正在加载"的微调器,使页面看起来好像还没有完成加载.有没有办法压制这个?

我被告知Orbited团队有抑制这个的黑客,但通过Orbited.js代码我无法弄清楚它们是什么.任何帮助将不胜感激.

comet orbited long-polling

3
推荐指数
1
解决办法
2534
查看次数