I am deploying a React app to my Apache server.
I can access the app on my-ip:5001, but when I go to my domain it gives me "404 the requested path could not be found". Btw. the domain has been set up and worked with an html file before working with react.
I did npm run build
and placed the build folder in the root of my server.
Made no changes to the package.json file.
I run the server using: serve -s -l 5001
Apache conf file:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName somedomain.com
ServerAlias www.somedomain.com
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:5001/
ProxyPassReverse / http://localhost:5001/
</VirtualHost>
</IfModule>
Any idea what might be going on here?
run serve -s from inside of the /build folder. exemple
C:\Users\zafriha\Desktop\myProject>build>cd..
C:\Users\zafriha\Desktop\myProject>npm install -g serve
C:\Users\zafriha\Desktop\myProject>serve -s build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With