对于1域,我怎样才能使用WordPress和Rails?

我已经为example.com安装了Rails,但是,我也想为我的博客使用WordPress。 所以我想example.com/blog是WordPress。 问题是,我想将WordPress放在与Rails不同的目录中,比如/srv/www/example-wp并且在/srv/www/example-ruby有Rails。 我怎样才能分开这个? 我认为这与虚拟主机有关,但我不确定这应该如何工作。

更新:

 <VirtualHost ip:80> ServerAdmin [email protected] ServerName example.com ServerAlias www.example.com DocumentRoot /srv/www/example-ruby/public/ Alias /blog /srv/www/example-wp/public/ <Directory /srv/www/example-wp/public/> AllowOverride all Order allow,deny Allow from all </Directory> <Directory /srv/www/example-ruby/public/> # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews </Directory> </VirtualHost> 

您正在寻找Apache中的“别名”function。

“别名”function允许您将用户“映射”到文档根目录以外的子目录。

你会像这样使用它:

 Alias /blog /srv/www/example-wp 

http://httpd.apache.org/docs/2.2/mod/mod_alias.html