Добавить файл .htaccess для apache2 и вставить код в файл
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.html [L]
и файл index.html изменить базу href
index.html
<base href="/angular/">
здесьangular - это каталог.
После этого откройте файл /etc/apache2/sites-enabled/000-default.conf и добавьте следующее правило в <VirtualHost>
tag
<Directory "/var/www/html">
AllowOverride All
</Directory>