Paste is a web application that allows you to store and share code snippets on any server. It's an open-source project that can be downloaded from https://phpaste.sourceforge.io/.
In this tutorial, we will guide you through the process of installing Paste on your Manjaro system.
Before proceeding with the installation, ensure that you have the following prerequisites:
Follow the below steps to install Paste on your Manjaro system:
Paste requires Apache, PHP, and MySQL or MariaDB to function. We can install these packages using the following command:
sudo pacman -S apache php mariadb
We need to install Git to clone Paste's source code from GitHub. Run the below command to install Git:
sudo pacman -S git
Now, let's clone the Paste source code from GitHub using Git. Run the following command:
git clone https://github.com/phpaste/phpaste.git
This command will clone the source code into the "phpaste" directory.
The Document Root is the directory where Apache serves the web files from. Paste's source code needs to be moved to this directory.
The default Document Root directory for Apache on Manjaro is "/srv/http/". You can move Paste's source code to this directory using the following command:
sudo mv phpaste /srv/http/
Paste requires a MySQL database to run. Let's create a new MySQL database for Paste using the following command:
sudo mysql -u root -p
This command will prompt you to enter the root password for MySQL.
Once you are in the MySQL shell, run the following command to create the new database:
CREATE DATABASE phpaste;
Exit the MySQL shell by typing "exit;".
Paste's source code needs to be updated with the MySQL database's credentials. Open the "config.inc.php" file located in the "phpaste" directory using your preferred text editor.
sudo nano /srv/http/phpaste/config.inc.php
Update the following variables with your MySQL database's credentials:
$sqlopts = [
'dsn' => 'mysql:host=localhost;dbname=phpaste',
'user' => 'root',
'password' => '',
];
We need to change the ownership and permissions of the "phpaste" directory so that Apache can access it.
Run the following command to change the ownership to the Apache user:
sudo chown -R http:http /srv/http/phpaste/
Run the following command to change the permissions to 755:
sudo chmod -R 755 /srv/http/phpaste/
Finally, restart the Apache HTTP server using the following command:
sudo systemctl restart httpd
You have successfully installed Paste on your Manjaro system. You can access Paste by opening your web browser and navigating to http://localhost/phpaste/.
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!