развернуть проект vuejs с угловым - PullRequest
0 голосов
/ 29 ноября 2018

Я должен спроектировать, один уже запущен с правами root, например: http://www.example.com, и теперь я хочу, чтобы другой проект Vuejs был развернут в том же домене.скажем, на http://www.exampple.com/vue-project

Я использую apache2 и настроил его для возврата index.html корневого проекта (Angular)

Но я хочу, чтобы он возвращал файл index.html проекта vue, когдая открываю http://www.example.com/vue-project

Я попытался создать псевдоним для vue-project к корневому каталогу проекта vuejs

, и он работает, когда я удаляю код для возврата index.html углового проекта.

вот мой файл 000-default.conf

    <IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName www.example.com
Alias "/vue-project" "/etc/tether/vue-project/dist"

RewriteEngine On
#RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ http://www.%1%{REQUEST_URI} [L,NE,R=301]

RewriteCond %{REQUEST_URI} !^/index.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(json|css|gif|ico|jpg|js|png|swf|txt|svg|woff|ttf|eot)$
RewriteRule . /index.html [L]

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www

        # 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
ServerAlias example.com
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>
...