How to install 0bin on Manjaro
0bin is a minimalist, open-source, client-side encrypted pastebin that allows anyone to host anonymous plaintext files. In this tutorial, we will guide you on how to install 0bin on Manjaro.
Prerequisites
- A computer running Manjaro with a terminal window.
- A web browser to access the 0bin application.
Steps for Installing 0bin on Manjaro
Follow the below steps to install 0bin on your Manjaro machine:
Open your terminal window by pressing
Ctrl + Alt + Ton your keyboard.Install some necessary packages required for the 0bin installation. Type the command below to do so:
sudo pacman -S git nginx php-fpm mariadbNext, we need to install a few dependencies. We can do this by running the command below:
sudo pacman -S base-devel php-gd php-intl php-mcrypt php-sqlite php-tidy php-xmlClone the 0bin source code repository from Github to your system using the command below:
git clone https://github.com/Tygs/0bin.gitMove into the 0bin project directory:
cd 0binCopy the
conf.sample.phpfile to a newconf.phpfile:cp includes/conf.sample.php includes/conf.phpOpen the
conf.phpfile in a text editor to make some necessary modifications:nano includes/conf.phpIn the file, scroll down to the mariadb settings section and change it to fit the following:
$cfg['db']['type'] = 'mariadb'; $cfg['db']['server'] = 'localhost'; $cfg['db']['port'] = 3306; $cfg['db']['db'] = '0bin'; $cfg['db']['user'] = '0bin'; $cfg['db']['password'] = 'mysql_password';Save the file and exit the text editor.
Create a database in MariaDB:
Log in to MariaDB using the command below:
sudo mysql -u root -pEnter your root password when prompted. After logging in, create a new database called
0bin:CREATE DATABASE 0bin;Create a new user called
0binwith a password of your choice:CREATE USER '0bin'@'localhost' IDENTIFIED BY 'mysql_password';Finally, give the new user full permissions to the
0bindatabase:GRANT ALL ON 0bin.* TO '0bin'@'localhost';Exit the MariaDB console by typing
exit.Set up your web server (NGINX) to serve the 0bin application files. Create a new file in the
/etc/nginx/sites-available/directory called0bin:sudo nano /etc/nginx/sites-available/0binPaste the configuration below into the file:
server { listen 80 default_server; listen [::]:80 default_server; root /path/to/0bin; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include fastcgi.conf; fastcgi_pass unix:/run/php-fpm/php-fpm.sock; } }Replace
/path/to/0binwith the full path to your 0bin directory. Save and exit the file.Create a symbolic link to the newly created file:
sudo ln -s /etc/nginx/sites-available/0bin /etc/nginx/sites-enabled/0binRestart the NGINX web server to apply changes:
sudo systemctl restart nginxFinally, start the php-fpm service:
sudo systemctl start php-fpm
Congratulations! You have successfully installed 0bin on your Manjaro machine. You can access your 0bin instance via a web browser by navigating to http://localhost in your browser.