配置Apache,使其可以承载两个Rails应用程序

时间:2018-08-07 13:54:16

标签: apache ruby-on-rails-4 passenger

过去,我设法建立了一个RAILS应用程序。现在,我想使用同一台服务器来设置第二个和第三个Rails应用程序。

目前,我不确定如何配置apache配置。 也许我可以告诉您什么对我的第一个网站有效:

LoadModule passenger_module /home/cc/.rvm/gems/ruby-2.1.10/gems/passenger-4.0.41/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
    PassengerRoot /home/cc/.rvm/gems/ruby-2.1.10/gems/passenger-4.0.41
    PassengerDefaultRuby /home/cc/.rvm/gems/ruby-2.1.10/wrappers/ruby
</IfModule>

DocumentRoot /home/cc/s3/public
ServerAdmin EMAILPLACEHILDER
ServerName PLACEHOLDER.com
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#DocumentRoot /srv/www/vhosts/default/

DocumentRoot / home / cc / s3 / public /

# if not specified, the global error log is used
ErrorLog /var/log/apache2/error_log
CustomLog /var/log/apache2/access_log combined
# don't loose time with IP address lookups
HostnameLookups Off
# needed for named virtual hosts
UseCanonicalName Off
# configures the footer on server-generated documents
ServerSignature On



#ScriptAlias /cgi-bin/ "/srv/www/vhosts/default/cgi-bin/"

#<Directory "/srv/www/vhosts/default/cgi-bin">
#    AllowOverride None
#    Options +ExecCGI -Includes
#    Order allow,deny
#    Allow from all
#</Directory>

<Directory "/home/cc/s3/public">

    Options Indexes FollowSymLinks
     AllowOverride All
    Order allow,deny
    Allow from all
    Options -Multiviews
    RailsEnv development
</Directory>
 RewriteEngine On

RewriteRule "^/?$" "PLACEHOLDER.com"

</VirtualHost>

现在我该怎么做才能使其他站点正常运行。我想-首先,我创建了另一个RAILS项目。为了进行测试,它可以是旧项目的副本。我只是重命名了复制的文件夹-例如project2。

现在-这个project2是否需要第二个apache配置,还是我需要将两个信息都放入两个apache配置中?

此刻,如果我输入服务器的IP,我将跳至项目1(PLACEHOLDER.com)

例如,如果我添加了关键字,该如何做? http://PLACEHOLDER.com/project2-网站是否实际导航到project2?

我了解以后可以设置自定义网址。 希望我的要求是可以理解的。有人可以帮忙吗?

干杯, D。

0 个答案:

没有答案