PurritoBin is a simple and fast pastebin web application that allows users to upload, store and share code snippets. In this tutorial, we will show you how to install PurritoBin on FreeBSD latest version.
Before we begin, you must ensure that the following prerequisites are met:
The first step is to install the required packages for PurritoBin. You can do this by running the following command:
sudo pkg install git php72 php72-pdo_sqlite php72-pdo_mysql php72-curl
Once the packages are installed, we can proceed with the next step.
The next step is to clone the PurritoBin repository from Github. You can do this by running the following command:
sudo git clone https://github.com/PurritoBin/PurritoBin /usr/local/www/apache24/data/purritobin
This command will clone the repository to the /usr/local/www/apache24/data/purritobin directory.
The next step is to configure PurritoBin. To do this, navigate to the config directory inside the purritobin directory:
cd /usr/local/www/apache24/data/purritobin/config
Copy config.php.example to config.php:
cp config.php.example config.php
Next, edit config.php and update the following variables:
PURRITO_URL: The URL where you will access PurritoBin.PURRITO_EXPIRE: The number of days before a paste gets expired.DB_TYPE: The database type. In our case, it will be SQLite.DB_FILE: The path to the SQLite database file.To use SQLite, set DB_TYPE to sqlite and set DB_FILE to the path of your SQLite database file. For example:
define('DB_TYPE', 'sqlite');
define('DB_FILE', '/usr/local/www/apache24/data/purritobin/data/purritobin.sqlite');
Once you have configured the config.php file, you can proceed with the next step.
The next step is to set the correct permissions to the necessary directories. To do this, run the following command:
sudo chown -R www:www /usr/local/www/apache24/data/purritobin/
sudo chmod -R 755 /usr/local/www/apache24/data/purritobin/
The next step is to create an SQLite database for PurritoBin. To do this, navigate to the data directory and run the following command:
cd /usr/local/www/apache24/data/purritobin/data
touch purritobin.sqlite
This command will create an empty SQLite database file.
The final step is to configure Apache to serve PurritoBin. To do this, navigate to the /usr/local/etc/apache24/Includes/ directory and create a new file called purritobin.conf:
sudo nano /usr/local/etc/apache24/Includes/purritobin.conf
Add the following content to the file:
Alias /purritobin /usr/local/www/apache24/data/purritobin/public
<Directory /usr/local/www/apache24/data/purritobin/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Save the file and exit.
Finally, restart Apache to make the changes take effect:
sudo service apache24 restart
PurritoBin is now installed and configured on your FreeBSD Latest server. To access PurritoBin, open a web browser and navigate to the URL you set in the PURRITO_URL variable in the config.php file. For example, if you set PURRITO_URL to http://example.com/purritobin, then you would navigate to http://example.com/purritobin in your web browser.
You have successfully installed PurritoBin on your FreeBSD Latest server! You can now upload, store and share code snippets using PurritoBin.
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!