@@ -15,6 +15,7 @@ by [Harrier Central](https://www.harriercentral.com)
1515* pytz
1616* phpserialize
1717* mysql-connector
18+ * psutil
1819
1920### WP Event Manager Plugin
2021* WP Event Manager >= 3.1.21
@@ -24,19 +25,19 @@ by [Harrier Central](https://www.harriercentral.com)
2425
2526## RedHat based OS
2627* on RedHat/CentOS 7 you need to install python3.6 and pip from EPEL first
27- * on RedHat/CentOS 8 systems the package name changed to ` python3-pip `
28- ```
28+ * on RHEL/Rocky Linux 8 systems the package name changed to ` python3-pip `
29+ ``` shell
2930yum install python36-pip
3031```
3132
3233## Ubuntu 18.04 & 20.04
33- ```
34+ ``` shell
3435apt-get update && apt-get install python3-venv
3536```
3637
3738## Clone repo and install dependencies
3839* download and setup of virtual environment
39- ```
40+ ``` shell
4041cd /opt
4142git clone https://github.com/bb-Ricardo/wordpress-hash-event-api.git
4243cd wordpress-hash-event-api
@@ -45,6 +46,50 @@ python3 -m venv .venv
4546pip3 install -r requirements.txt || pip install -r requirements.txt
4647```
4748
49+ ## Install as systemd service
50+ If files have been installed in a different directory then the systemd service file
51+ needs to be edited.
52+
53+ Ubuntu
54+ ``` shell
55+ cp /opt/wordpress-hash-event-api/contrib/wordpress-hash-event-api.service /etc/systemd/system
56+ ```
57+ RHEL/Rocky Linux
58+ ``` shell
59+ sed -e ' s/nogroup/nobody/g' /opt/wordpress-hash-event-api/contrib/wordpress-hash-event-api.service > /etc/systemd/system/wordpress-hash-event-api.service
60+ ```
61+
62+ Enable and start service
63+ ``` shell
64+ systemctl daemon-reload
65+ systemctl start wordpress-hash-event-api
66+ systemctl enable wordpress-hash-event-api
67+ ```
68+
69+ ## Install as OpenRC service
70+ The [ uvicorn.confd] ( contrib/uvicorn.confd ) config file needs to be copied to ` /etc/conf.d/ ` .
71+ Let's assume the API is called ` nerd-h3 ` .
72+ ``` shell
73+ cp contrib/uvicorn.confd /etc/conf.d/uvicorn.nerd-h3
74+ chmod 644 /etc/conf.d/uvicorn.nerd-h3
75+ ```
76+
77+ The init script [ uvicorn.openrc] ( contrib/uvicorn.openrc ) needs to be copied to ` etc/init.d/ `
78+ and symlinked.
79+ ``` shell
80+ cp contrib/uvicorn.openrc /etc/init.d/uvicorn
81+ chmod 755 /etc/init.d/uvicorn
82+ cd /etc/init.d
83+ ln -s uvicorn uvicorn.nerd-h3
84+ ```
85+
86+ Then the correct values need to be set in ` /etc/conf.d/uvicorn.nerd-h3 ` . After the configuration
87+ is finished the service can be started.
88+ ``` shell
89+ /etc/init.d/uvicorn.nerd-h3 start
90+ rc-update add uvicorn.nerd-h3 default
91+ ```
92+
4893## Docker
4994
5095Run the application in docker container
@@ -74,7 +119,7 @@ All options are described in the example file.
74119- [x] add docker file
75120- [x] try to add "auto-install", this should set up the WordPress Event Manager to add all available fields to all events
76121- [x] requirements.ini
77- - [ ] add OpenRC init script and config to server API via uvicorn
122+ - [x ] add OpenRC init script and config to server API via uvicorn
78123- [ ] add nginx config example
79124 - [ ] add CORS Headers to nginx config
80125
0 commit comments