htdocs/README.md

39 lines
1.2 KiB
Markdown
Raw Normal View History

2024-11-02 11:18:41 +01:00
# Website<br/>
This is all the code for the website (deadvey.com)<br/>
2023-12-29 02:35:11 +01:00
2024-11-02 11:18:41 +01:00
# Node
The nodejs code that is executed in the background is in /node<br/>
You can execute the node code in crontab (`crontab -e`)<br/>
eg:<br/>
2024-11-02 11:20:01 +01:00
```crontab
2024-11-02 11:18:41 +01:00
* * * * * node /var/www/html/node/makeblogs.js
* * * * * node /var/www/html/node/newsletter.js
* * * * * node /var/www/html/node/updatefeed.js
2024-01-08 19:08:58 +01:00
2024-11-02 11:18:41 +01:00
etc...
```
# Newsletter
<br/>
2024-11-02 11:20:01 +01:00
If you want to add members to the newsletter, I store a file as /etc/newsletter_members.js:<br/>
2024-11-02 11:42:48 +01:00
```js
2024-11-02 11:18:41 +01:00
let members = ["member1@gmail.com","member2@outlook.com"]
if (typeof module !== 'undefined' && module.exports) {
module.exports = members;
}
2024-11-02 11:42:48 +01:00
2024-11-02 11:18:41 +01:00
```
2024-11-02 11:42:48 +01:00
2024-11-02 11:32:56 +01:00
# Setup
I use apache2 to run the website and accept traffic, though for the main site it runs on nodejs which is hosted on port :8003<br/>
You can run /node/app.js in a tmux session for the website<br/>
You can add this to /etc/apache2/sites-enables/000-default.conf to forward to nodejs:<br/>
`ProxyPass / http://locahost:8003/`<br/>
And this if you want other sites that use apache2 not nodejs (as exceptions)<br/>
`ProxyPass /wordpress !`<br/>
You can also check the node page is running with `curl http://localhost:8003`<br/>