我正在设置一个服务器,我需要在其中运行 Ruby On Rails 3 应用程序以及一些 PHP 网站。服务器是运行 Apache 2.4.3 的 CentOS 5.8 机器。该服务器用于测试和预生产,因此性能不是问题。
我正在为 Rails 应用程序使用 Phusion Passenger,并且我创建了一堆虚拟主机(带有关联的文件夹和数据库帐户)。然后,我打算为 PHP 使用其他 v-hosts。
是否可以?我应该如何进行?
非常感谢你
详细信息:
httpd.conf:
LoadModule passenger_module /app/auser/.rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /app/auser/.rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.17
PassengerRuby /app/auser/.rvm/wrappers/ruby-1.9.3-p286/ruby
(...)
##
## Virtual hosts
Include conf/extra/httpd-vhosts-phpmyadmin.conf
Include conf/extra/httpd-vhosts-rails01.conf
Include conf/extra/httpd-vhosts-rails02.conf
Include conf/extra/httpd-vhosts-php01.conf
Include conf/extra/httpd-vhosts-php02.conf
....
乘客管理的 v-hosts 将类似于:
包括 conf/extra/httpd-vhosts-rails01.conf
<VirtualHost *:80>
ServerName rails01.lcl
DocumentRoot "/app/auser/apps/rails01/public"
<Directory "/app/auser/apps/rails01/public">
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
基于 PHP 的 v-hosts 将类似于:包含 conf/extra/httpd-vhosts-php01.conf
<VirtualHost *:80>
ServerName php01.lcl
DocumentRoot "/app/auser/apps/php01/public"
<Directory "/app/auser/apps/php01/public">
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>