FreshRSS installation on Oracle Cloud
In this article, the installation of FreshRSS on Oracle Cloud with Ubuntu OS is presented. It can be a reference for you if you want to install FreshRSS or other similar program on VPS.
Add new user
It is general recommended to add a new user to a new VPS and remove access to the root user to increase security.
1 | adduser yue |
Then we need to add a ssh public key to the new user. On local machine:
1 | ssh-keygen -t ed25519 |
Install NGINX
Install the NGINX Open Source package:
1 | sudo apt update |
Make TCP ports available on Oracle cloud
For Oracle Cloud, all ports except 22 are blocked. To use the TCP ports 80 and 443, we need to enable them in the following way:
Open the navigation menu and click Networking, and then click Virtual Cloud Networks.
Select the VCN you created with your compute instance.
With your new VCN displayed, click
subnet link. The public subnet information is displayed with the Security Lists at the bottom of the page. A link to the Default Security List for your VCN is displayed.
Click the Default Security List link.
The default Ingress Rules for your VCN are displayed.
- In the Add Ingress Rules dialog box, set the following options to open port 22 for SSH access (if it isn't already open):
- Stateless: Leave this box unchecked. This makes the rule stateful, which means that any response to the incoming traffic is allowed back to the originating host, regardless of any egress rules applicable to the instance.
- Source Type: Select CIDR.
- Source CIDR: Enter 0.0.0.0/0, which indicates that traffic from all sources on the internet is allowed.
- IP Protocol: Select TCP.
- Source Port Range: Accept the default All.
- Destination Port Range: Enter 22, to allow access through SSH.
- Description: Add an optional description.
- At the bottom of the dialog box, click +Another Ingress Rule, and enter the values for another rule. Do this for as many times as necessary, to create all the rules you need, and then click Add Ingress Rules.
Then in your VPS, enable these ports:
1
2
3sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo netfilter-persistent save
Install FreshRSS
First change your DNS so that the VPS's IP address points to the URL
we want to use to the FreshRSS. For me, it is rss.yj0.se
.
Then we can add the NGINX config for FreshRSS at the file
/etc/nginx/sites-available/rss.yj0.se
:
1 | server { |
To enable this configuration:
1 | sudo ln -s /etc/nginx/sites-available/rss.yj0.se /etc/nginx/sites-enabled/rss.yj0.se |
Next, install PHP and the necessary modules
1 | sudo apt install php php-curl php-gmp php-intl php-mbstring php-sqlite3 php-xml php-zip php7.4-fpm |
Next, we’ll need to install and configure MySQL. Install MySQL components like so:
1 | sudo apt install mysql-server mysql-client php-mysql |
MySQL can now be started:
1 | service mysql start |
We’ll need to configure MySQL.
1 | mysql_secure_installation |
And restart it
1 | service mysql restart |
With MySQL ready, we can continue to config FreshRSS. FreshRSS needs
git
, so we install it:
1 | sudo apt install git |
Next, change to the install directory and download FreshRSS using git
1 | cd /usr/share/ |
Change to the new FreshRSS directory, and set the permissions so that your Web server can access the files
1 | cd FreshRSS |
We’ll also need to allow the data folder to be written to, like so:
1 | sudo chmod -R g+w ./data/ |
Optional: If you would like to allow updates from the Web interface, set write permissions
1 | chmod -R g+w . |
Finally, symlink the public folder to the root of your web directory
1 | ln -s /usr/share/FreshRSS/p /var/www/html/ |
Now the installation of FreshRSS is finished. But it needs a database
to work. We will create a MySQL database: From the MySQL prompt
(MariaDB [(none)]>
), run the following commands,
substituting <username>
,
<password>
, and <database_name>
for real values.
1 | CREATE USER '<username>'@'localhost' IDENTIFIED BY '<password>'; |
Now we can use FreshRSS.
Setup automatic feed updating
To run the updater script every hour, and 10 minutes past the hour,
edit /etc/crontab
and append the following line:
1 | 10 * * * * www-data php -f /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 |
Install HTTPS certificates
To be able to use HTTPS for secure connection, we can use the Certbot from EFF for free:
1 | sudo apt-get update && sudo apt-get upgrade -y |
To add certificate for the newly installed FreshRSS, run the following command:
1 | sudo certbot --nginx -d rss.yj0.se |