Installing OpenCATS on Ubuntu 18.04.2 - VPS environment
Hopefully this might help someone who also wants to install OpenCATS in a VPS environment.
I am not a Linux/Unix expert, so you might find some faster/easier way to install OpenCATS than what I did.
What I wanted to do was to eventually have OpenCATS running on a VPS environment and have SSL enabled.
I spent a fair amount of time downloading various versions of Ubuntu and running them in a VirtualBox so I could test and see what worked and what didn't.
I managed to install OpenCATS on Ubuntu 18.04.2.
Following the documentation for installing OpenCATS on Ubuntu 16.04 -
https://opencats-documentation.readthed ... 16.04.html, the majority of the documentation is correct, expect for a few parts.
1. Setting up your MySQL/MariaDB database
CREATE USER ‘opencats’@’localhost’ IDENTIFIED BY ‘databasepassword’;
mysql> CREATE DATABASE opencats;
mysql> GRANT ALL PRIVILEGES ON ‘opencats’.* TO ‘opencats’@’localhost’ IDENTIFIED BY ‘databasepassword’;
mysql> exit;
I had issues running the above commands, as the "‘" threw out an error, so when I changed each of the commands with
"'" it worked, except for the "GRANT ALL PRIVILEGES ON ‘opencats’.* TO ‘opencats’@’localhost’ IDENTIFIED BY ‘databasepassword’;"
Here is what I changed:
mysql> CREATE USER 'opencats'@'localhost' IDENTIFIED BY 'databasepassword';
mysql> CREATE DATABASE opencats;
mysql> GRANT ALL PRIVILEGES ON opencats.* TO 'opencats'@'localhost' IDENTIFIED BY 'databasepassword';
mysql> exit;
Also, the command GRANT ALL PRIVILEGES ON 'opencats'.* TO 'opencats'@'localhost' IDENTIFIED BY 'databasepassword'; gave me an error as well, so I changed the 'opencats'.* to opencats.*
When creating and setting up the various folders/directories after the installation of OpenCATS, I had to create the folder opencats/upload and then change the access permissions using "sudo chmod 770 opencats/upload"
The rest of the installation and configuration went well.
I was able to upload a number of CVs (pdf and doc formats), and these imported without any issues.
So everything worked on the VirtualBox environment, now I needed to install Ubuntu 18.04.2 on a VPS environment, and the trial version that I was using gave me 7 days to do this in before I would be charged.
Now, I wanted to get my OpenCATS on VirtualBox copied over to the VPS, to do this I read through the "OpenCATS Backup/Restore and Upgrade Instructions-THIS SECTION INCOMPLETE! Documentation and managed to both export the Database and the Attachments folder from VirtualBox by using the following commands:
Exporting the Database:
1. sudo su
2. cd /var/tmp
3. mysqldump -u username -p database_name > databasefile.sql
Zipping the Attachments folder:
1. sudo su
2. cd /var/tmp
3. zip -r attachments.zip /var/www/html/opencats/attachments
I copied the databasefile.sql and the attachments.zip to my laptop and then using WinSCP, copied them to the VPS environment in /var/tmp.
I tried to import the database on the VPS environment got an error, so after looking up how I could import a database, I found the following worked:
1. sudo mysql -u root -p
within MariaDB, I ran:
2. drop database databasename;
3. create database databasename;
4. GRANT ALL PRIVILEGES ON opencats.* TO 'opencats'@'localhost' IDENTIFIED BY 'databasepassword';
5. exit;
6. sudo mysqldump -u username -p database_name < databasefile.sql
Now the database was imported, next to extract the attachments using the command
1. sudo su
2. cd /var/tmp
3. unzip attachments.zip -d /var/www/html/opencats/attachments
Note: You will be asked if you want to overwrite the files/folders
The last step was to have OpenCATS use SSL, so before I could enable SSL, I had to setup a DNS entry with my hosting provider, and waited 24 hours for DNS to be functioning.
Once DNS was setup and working, I followed this tutorial "How to secure Apache with Let's Encrypt on Ubuntu 18.04" -
https://www.arubacloud.com/tutorial/how ... 18-04.aspx, which worked a treat for me.
To test that OpenCATS is secure using the SSL, you can use the website:
https://www.ssllabs.com/ssltest/analyze.html
I also changed the index.html file which is located in /var/www/html/ this is the standard Apache information file.
One last point, I got an error (something along the lines of permission issues) when I tried to add an attachment for a candidate, so I had to set the permissions (using WinSCP) for the attachments folder to 0775 and made sure that the permissions were set recursively. Then it worked.
That was it.
Hope this helps.
Regards
Mak