Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy angular application in apache folder

Tags:

angular

apache

I have Apache server which is running Angular 6 application under /var/www/html/<angular_root>. I tried to add one folder /var/www/html/admin/<angular_root> but I get errors Failed to load resource: the server responded with a status of 404 (Not Found). Do you know what configuration I need to implement?

My current apache configuration is:

<Directory /var/www/html/admin>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
like image 296
Peter Penzov Avatar asked Nov 21 '25 14:11

Peter Penzov


1 Answers

Your angular project(s base href is wrong. when you deploy your application, specify base-href on the cmdline :

ng build --prod --base-href ./

for reference https://angular.io/guide/deployment

like image 92
sancelot Avatar answered Nov 24 '25 05:11

sancelot