GitLab + apache + Phusion Passenger - >没有这样的文件或目录 - config / environment.rb

时间:2012-12-14 00:54:55

标签: ruby-on-rails git apache passenger gitlab

我正在使用官方手册https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md安装Gitlab,但我不想使用ngix,而是使用apache与乘客。我必须承认我还是一个Linux新手。

无论如何,这是错误:

  

错误消息:没有这样的文件或目录 - config / environment.rb

这是我的apache配置:

  

          ServerAdmin webmaster @ localhost

    DocumentRoot /var/www
    RailsBaseURI /gitlab
    RackBaseURI /gitlab
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>
    <Directory /var/www/gitlab>
            Options -MultiViews
    </Directory>


    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

任何想法我做错了什么?

2 个答案:

答案 0 :(得分:1)

你不应该在你的配置中有这个:

RailsBaseURI /gitlab
RackBaseURI /gitlab

如Phusion Passenger文档中所述,“RailsBaseURI”表示“我在该URI下有一个Rails 2 应用程序”。 Gitlab是一个Rails 3应用程序,所以你需要“RackBaseURI”。但是你指定了两者,并且“RailsBaseURI”具有优先权,因此Phusion Passenger认为/ gitlab是一个Rails 2应用程序。

摆脱“RailsBaseURI”,你应该没事。

答案 1 :(得分:0)

嗯很可能是

之一
DocumentRoot /var/www
RailsBaseURI /gitlab
RackBaseURI /gitlab

只是指向错误的目录。您在哪个目录中检出了gitlab代码?它与值相匹配吗?

顺便说一下,我使用的设置与你运行gitlab(apache + passenger)几乎相同,并且只设置了DocumentRoot。

供您参考,这是我的虚拟主机配置,也许它会帮助您:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName git.your_server_address

        PassengerMinInstances 1
        DocumentRoot /home/gitlab/gitlab/public
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>
相关问题