Update README.md
This commit is contained in:
parent
51697200e5
commit
ee8e304381
29
README.md
29
README.md
@ -1,7 +1,9 @@
|
|||||||
# Website<br/>
|
# Website<br/>
|
||||||
|
|
||||||
This is all the code for the website (deadvey.com)<br/>
|
This is all the code for the website (deadvey.com)<br/>
|
||||||
|
|
||||||
# Node
|
# Node<br/>
|
||||||
|
|
||||||
The nodejs code that is executed in the background is in /node<br/>
|
The nodejs code that is executed in the background is in /node<br/>
|
||||||
You can execute the node code in crontab (`crontab -e`)<br/>
|
You can execute the node code in crontab (`crontab -e`)<br/>
|
||||||
eg:<br/>
|
eg:<br/>
|
||||||
@ -14,8 +16,8 @@ etc...
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Newsletter
|
# Newsletter<br/>
|
||||||
<br/>
|
|
||||||
If you want to add members to the newsletter, I store a file as /etc/newsletter_members.js:<br/>
|
If you want to add members to the newsletter, I store a file as /etc/newsletter_members.js:<br/>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@ -30,24 +32,33 @@ if (typeof module !== 'undefined' && module.exports) {
|
|||||||
# Apache2 and Node.js Integration
|
# Apache2 and Node.js Integration
|
||||||
|
|
||||||
This project utilizes Apache2 as a reverse proxy to handle incoming web traffic and forward requests to a Node.js application.
|
This project utilizes Apache2 as a reverse proxy to handle incoming web traffic and forward requests to a Node.js application.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
To set up Apache2 as a reverse proxy for your Node.js app:
|
To set up Apache2 as a reverse proxy for your Node.js app:
|
||||||
|
|
||||||
1. Start your Node.js application (/node/app.js) on port 8003. You can run the application in a tmux session using the command:\n
|
1. Start your Node.js application (/node/app.js) on port 8003. You can run the application in a tmux session using the command:<br/>
|
||||||
|
|
||||||
`node app.js`<br/>
|
|
||||||
|
```sh
|
||||||
|
node app.js
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
2. Edit the Apache configuration file /etc/apache2/sites-enabled/000-default.conf and add the following lines to forward requests to the Node.js app:<br/>
|
2. Edit the Apache configuration file /etc/apache2/sites-enabled/000-default.conf and add the following lines to forward requests to the Node.js app:<br/>
|
||||||
|
|
||||||
|
|
||||||
`ProxyPass / http://localhost:8003/`<br/>
|
```
|
||||||
|
ProxyPass / http://localhost:8003/
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
3. If you have other sites or applications running on Apache2 that should not be proxied to Node.js, you can add exceptions like this:<br/>
|
3. If you have other sites or applications running on Apache2 that should not be proxied to Node.js, you can add exceptions like this:<br/>
|
||||||
|
|
||||||
|
|
||||||
`ProxyPass /wordpress !`<br/>
|
```
|
||||||
|
ProxyPass /wordpress !
|
||||||
|
```
|
||||||
|
|
||||||
Replace /wordpress with the appropriate path for your exception:<br/>
|
Replace /wordpress with the appropriate path for your exception:<br/>
|
||||||
|
|
||||||
@ -56,7 +67,9 @@ Replace /wordpress with the appropriate path for your exception:<br/>
|
|||||||
To verify that the Node.js application is running and accessible through Apache2, you can use the curl command:
|
To verify that the Node.js application is running and accessible through Apache2, you can use the curl command:
|
||||||
|
|
||||||
|
|
||||||
`curl http://localhost:8003`<br/>
|
```sh
|
||||||
|
curl http://localhost:8003
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
This should return the response from your Node.js application.
|
This should return the response from your Node.js application.
|
||||||
|
Loading…
Reference in New Issue
Block a user