I'm working in a react-js project and I have a cloud server which has installed apache server. My question is could I set my react-project on apache server?.
-
3React.js is principally a browser-based technology. And as such the type of server does not make a difference. If you want to server side render in node.js, then you could still proxy through apache. So, I don't see any limit there. – Davin Tryon Aug 19 '16 at 18:54
-
**for React router 4.** [see it may help](https://stackoverflow.com/questions/52369027/why-is-that-when-i-run-my-react-build-on-apache-just-blank-page-appears/52458961#52458961) – Abdul Moiz Sep 22 '18 at 17:12
-
This might help you: https://stackoverflow.com/questions/42461279/how-to-deploy-a-react-app-on-apache-web-server – Aftab22 Apr 16 '19 at 05:02
3 Answers
As Davin Tyron says, react
is a browser technology, this is that aside from the client's browser downloading the app from your server, everything happens on client's computer.
Just make sure your apache (or any other server) serves the proper html and js files for your react app to run!

- 5,632
- 3
- 29
- 39
You must change apache config file with code
<VirtualHost *:80> DocumentRoot/Users/Your User Name/Sites/ <Directory"/Users/Your User Name/Sites/"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>

- 134
- 6
-
That because Apache server work on port 80, but node and express work default on port 3000. For that is need this and other settings, how you can get proximity for showing node-react app. Or make react application without use node. – Miodrag Trajanovic Dec 18 '20 at 21:52
No you can't set your project on apache server. I think you have to use Docker for such type of thing.
Does that make sense? React is just a front end library, which is used for making reusable UI components.

- 14,664
- 4
- 29
- 41

- 91
- 6
-
1Yes, you can. As you say, React.js is just a javascript view library (like jQuery, Angular ...etc), an Apache server is made to serve ressources to client (ressources like HTML, CSS, JS). After the client have receive this files/data, his browser is able to compile them and show him the page he want to see. – Julha Mar 01 '17 at 19:49