This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
If you are self-hosting this website in an clean installation of Apache webserver on Ubuntu, please take note of the following configuiration requirements:
Open the general configuration file for Apache (adjust to your particular circumstances)
sudo nano /etc/apache2/apache2.conf
and amend/add the following lines:
<Directory /var/www/website/build>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
You can use the following command:
sudo a2enmod rewrite
Create a new .htaccess
file with
sudo nano /var/www/website/build/.htaccess
And enter the following content:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
With the following command:
sudo systemctl restart apache2