I have created a basic React App from https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm here , I want to run this test code on Apache based server, I know that I need t
check your build directory gracefully all the files will be available in the build folder.
asset-manifest.json
favicon.ico
manifest.json
robots.txt
static assets
index.html
precache-manifest.ddafca92870314adfea99542e1331500.js service-worker.js
4.copy the build folder to your apache server i.e /var/www/html
sudo cp -rf build /var/www/html
go to sites-available directory
cd /etc/apache2/sites-available/
open 000-default.conf file
sudo vi 000-default.conf and rechange the DocumentRoot path
enter image description here
Now goto apache conf.
cd /etc/aapche2
sudo vi apache2.conf
add the given snippet
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
make a file inside /var/www/html/build
sudo vi .htaccess
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
9.sudo a2enmod rewrite
10.sudo systemctl restart apache2
restart apache server
sudo service apache2 restart
thanks, enjoy your day