DOO*_*iac 5 httpd.conf redirect apache-2.2
我们目前在 为 IT 设置了一个内部站点it.example.com,该站点托管一个Redmine站点。
我想设置 Apache,以便在用户访问时将kb.example.com其重定向到http://it.example.com/some/path/to/knowledge-base快捷方式。
我<VirtualHost>在 httpd.conf 的末尾添加了一个,现在每当我尝试访问主站点 (it.example.com) 时,浏览器都会进入无限重定向循环:
这是我的httpd.conf:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.37
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
ServerName it.example.com
ServerAdmin support@example.com
DocumentRoot /var/www/redmine-2.4.3/public
ErrorLog logs/redmine_error_log
SetEnv RAILS_ENV production
SetEnv RailsEnv production
#If you are using mod_fcgid and are going to upload files larger than
#131072 bytes you should consider adding the following line
#that allows to upload files up to 20 mb
MaxRequestLen 20971520
<Directory "/var/www/redmine-2.4.3/public">
Options Indexes ExecCGI FollowSymLinks -MultiViews
Order allow,deny
Allow from all
AllowOverride all
</Directory>
<VirtualHost *:80>
ServerName kb.example.com
Redirect / http://it.example.com/projects/knowledge-base
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
所以看起来 VirtualHost 被忽略了,kb.example.com 的规则总是有效 - 从而导致无限重定向......
我认为您需要将现有it.example.com定义包装在一个<VirtualHost>块中。我认为这是因为没有 vhost 定义it.example.com,kb.example.com成为默认 vhost。如果找不到合适的虚拟主机,这就是将提供的服务,然后返回到自身......
| 归档时间: |
|
| 查看次数: |
10531 次 |
| 最近记录: |