Deploy Angular 2 to Apache Server

后端 未结 8 1986
半阙折子戏
半阙折子戏 2020-12-07 16:47

I want to deploy an Angular 2 application on an Apache server. I\'ve read various guides like this and this but none of them is working. I have npm and ng

8条回答
  •  旧巷少年郎
    2020-12-07 17:51

    I have create distribution directory as public. I have changed only virtual host setting of apache.

    
        ServerAdmin webmaster@localhost
        ServerName frontend.loc
        DocumentRoot /var/www/frontend/public
        
            Options FollowSymLinks
            Allow from all
            AllowOverride All
            
                    RewriteEngine on
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(.*)$ index.html
            
        
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    
    

    ~

提交回复
热议问题