Ratchet websocket server to synchronize API push events to a MySQL database
Open inbound connections to the socket ports with
sudo yum install iptables-services
sudo systemctl start iptables
sudo systemctl enable iptables
sudo iptables -A INPUT -p tcp -m tcp --dport PORT_NUMBER -j ACCEPT
sudo service iptables save
ufw: sudo ufw allow 5732
Create database(s), tables and user(s) with the DDL template in sql/create.sql
mysql -uroot -p < sql/create.sql
-
Copy configuration/configuration.json.dist to configuration/configuration.json
-
Edit the variables accordingly
-
Run server with
php cli/server.php path_to/configuration_file.json
- ln -s /usr/share/ratchet-sync/systemd/ratchet.service /etc/systemd/system
- systemctl daemon-reload
- systemctl enable ratchet
- systemctl start ratchet