Configuration
A. Create a configuration file
-
cp config.sample.json config.json
-
Edit the configuration file to include your MySQL database details. Replace the following lines with your own values:
"database": {
"dialect": "postgres",
"host": "localhost",
"port": 5432,
"username": "chatpion",
"password": "chatpion",
"database": "chatpion"
}
with:
"database": {
"dialect": "mysql",
"host": "localhost",
"port": 3306,
"username": "example:suresh",
"password": "xxxxxxxx",
"database": "chatpion"
}
now need to add directory index in apache2.conf file
example
<Directory /var/www/html/kethapractices>
DirectoryIndex index.php
AllowOverride All
Require all granted
Order allow,deny
Allow from all
</Directory>
Need to move .htaccess file to publish folder
B. Create a new MySQL database and user mysql -u root -p CREATE DATABASE chatpion; CREATE USER 'chatpion'@'localhost' IDENTIFIED BY 'chatpion'; GRANT ALL PRIVILEGES ON chatpion.* TO 'chatpion'@'localhost'; FLUSH PRIVILEGES;
C. Configure Reverse Proxy 1.Configure a reverse proxy server such as Apache to serve Chatpion:
For Apache:
sudo apt-get install apache
Configure Nginx to serve Chatpion:
server {
listen 80;
server_name xxxxxxxxxxxxxxxxxxxxxxxxxxxx
return 301 https://demo.net;
}
server {
listen 443 ssl;
server_name xxxxxxxxxx
ssl_certificate /etc/ssl/certs/chatpion.crt;
ssl_certificate_key /etc/ssl/private/chatpion.key;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1
D. Firewall configuration A. Configure Firewall
Allow incoming traffic on port 3000:
sudo ufw allow 3000/tcp