Назад | Перейти на главную страницу

Настройка apache для использования определенного пути для wsgi для Review Board

Я пытаюсь настроить Доска обзоров на машине Ubuntu 18. В составе Review Board есть инструмент, который генерирует файл apache .conf, который вы должны добавить в список доступных сайтов. Это противоречит уже существующим 000-default.conf на сервере. Совет по обзору предлагает мне просто удалить файл .conf по умолчанию, но это невозможно на этом компьютере, поскольку он также используется для обслуживания базового index.php в корне домена.

Я хочу сделать так, чтобы foo.com продолжать работать в обычном режиме и иметь foo.com/reviewboard используйте решение WSGI от Review Board.

Есть ли способ указать, что foo.com/reviewboard следует использовать файл .conf, созданный Наблюдательным советом, или добавить соответствующую информацию в 000-default.conf файл?

Это 000-default.conf файл:

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Это файл .conf, созданный Контрольной комиссией:

<VirtualHost *:80>
        ServerName localhost
        DocumentRoot "/var/www/reviewboard/htdocs"

        # Error handlers
        ErrorDocument 500 /errordocs/500.html

        WSGIPassAuthorization On
        WSGIScriptAlias "/reviewboard" "/var/www/reviewboard/htdocs/reviewboard.wsgi/reviewboard"

        <Directory "/var/www/reviewboard/htdocs">
                AllowOverride All
                Options -Indexes +FollowSymLinks
                Allow from all
        </Directory>

        # Prevent the server from processing or allowing the rendering of
        # certain file types.
        <Location "/reviewboard/media/uploaded">
                SetHandler None
                Options None

                AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
                AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb

                <IfModule mod_php5.c>
                        php_flag engine off
                </IfModule>

                # Force all uploaded media files to download.
                <IfModule mod_headers.c>
                        Header set Content-Disposition "attachment"
                </IfModule>
        </Location>

        # Alias static media requests to filesystem
        Alias /reviewboard/media "/var/www/reviewboard/htdocs/media"
        Alias /reviewboard/static "/var/www/reviewboard/htdocs/static"
        Alias /reviewboard/errordocs "/var/www/reviewboard/htdocs/errordocs"
        Alias /reviewboard/favicon.ico "/var/www/reviewboard/htdocs/static/rb/images/favicon.png"
</VirtualHost>