Shynet is an open-source, self-hosted analytics tool that helps you track website visitors and their interactions on your site. In this tutorial, we'll go through the steps to install Shynet on a Fedora Server.
Before starting, make sure of the following prerequisites:
34
) installed on your systemsudo
, curl
, nano
or vi
Follow the steps below to install Shynet:
It's always a best practice to update your system first, so run the commands below to update your Fedora system.
$ sudo dnf update -y
$ sudo dnf upgrade -y
To clone the Shynet repository, we need to install Git first. Run the following command in the terminal:
$ sudo dnf install git -y
After installation, you can navigate to your desired directory and clone Shynet repository using Git.
$ cd /opt/
$ sudo git clone https://github.com/milesmcc/shynet.git
Shynet requires some PHP extensions and packages to get installed on the server. Run the following command to install them:
$ sudo dnf install php php-mbstring php-xml php-json php-gd php-posix php-pdo php-mysqlnd mysql -y
Shynet stores its data in a MySQL database. Run the following command to install the MySQL server and client.
$ sudo dnf install mariadb mariadb-server -y
Start MySQL service and enable it to start after the system restarts.
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb
Run the following command to secure your MySQL installation for further use, set up the root password, or remove anonymous users.
$ sudo mysql_secure_installation
Create a new database and user for Shynet. Replace shynet_database
with your desired database name, and shynet_user
and shynet_password
with your desired user information.
$ sudo mysql -u root -p
CREATE DATABASE shynet_database;
CREATE USER 'shynet_user'@'localhost' IDENTIFIED BY 'shynet_password';
GRANT ALL PRIVILEGES ON shynet_database.* TO 'shynet_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Shynet uses the Apache web server to run PHP code. Install the Apache server and start its service.
$ sudo dnf install httpd -y
$ sudo systemctl start httpd
$ sudo systemctl enable httpd
Add Shynet virtual host to configure Apache to serve Shynet files. Run the following command to create a new file for Shynet virtual host definition. Replace example.com
with your domain name.
$ sudo nano /etc/httpd/conf.d/shynet.conf
Add the following content at the file end.
<VirtualHost *:80>
ServerName example.com
DocumentRoot /opt/shynet/web
<Directory /opt/shynet/web>
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/httpd/shynet_error_log
CustomLog /var/log/httpd/shynet_access_log combined
</VirtualHost>
Save and exit from the file.
Copy the configuration file and configure it with your MySQL credentials.
$ cd /opt/shynet
$ sudo cp app/config/config.yaml.dist app/config/config.yaml
$ sudo nano app/config/config.yaml
Update the following lines with your MySQL database, username, and password.
database:
adapter: pdo_mysql
host: localhost
port: 3306
dbname: shynet_database
user: shynet_user
password: shynet_user_password
Save and exit.
Shynet encrypts data using a secret key. Run the following command to generate a random encryption key.
$ sudo openssl rand -hex 32
Copy the output, open the config file, and paste it in the encryption
section.
encryption:
privateKey: "paste_your_key_here"
Save and exit.
Restart the Apache server to load the configuration changes.
$ sudo systemctl restart httpd
Open your website's FQDN address in your web browser (http://example.com
) and see if you're getting the Shynet setup page to proceed with further installation.
Congratulations! You have successfully installed Shynet on your Fedora server.
In this tutorial, we learned how to install Shynet on Fedora Server Latest. We also configured Shynet with Apache server and MySQL database. Shynet provides various features to track website visitors and their actions on your website. You can start exploring Shynet to take effective decisions based on the user interaction data.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!