How to Install File Sharing from GitHub on EndeavourOS
File Sharing is an open-source web application that allows users to share files easily. In this tutorial, we will learn how to install it on EndeavourOS Latest.
Requirements
- EndeavourOS installed on your computer
- Internet connection
Step 1: Install Required Tools
Before we start the installation process, we need to make sure that required tools are installed. Open the terminal and run the following command:
sudo pacman -S git apache php php-apache composer
This command will install Git, Apache, PHP, PHP-Apache, and Composer on your system.
Step 2: Clone the Repository
Next, we need to clone the File Sharing repository from GitHub. Run the following command to clone the repository:
git clone https://github.com/axeloz/filesharing.git /srv/http/filesharing
This command will clone the File Sharing repository to the /srv/http/filesharing directory.
Step 3: Install Dependencies
Now, we need to install the dependencies using Composer. Navigate to the File Sharing directory using the terminal and run the following command:
cd /srv/http/filesharing
composer install
This command will install all the required dependencies.
Step 4: Configure Apache
Next, we need to configure Apache. Open the Apache configuration file using the terminal:
sudo nano /etc/httpd/conf/httpd.conf
Add the following lines at the end of the file:
Alias /filesharing "/srv/http/filesharing/public"
<Directory "/srv/http/filesharing/public">
AllowOverride All
Require all granted
</Directory>
Save the changes and exit the editor.
Step 5: Enable Apache Modules
In this step, we need to enable the Apache modules required by File Sharing. Run the following command:
sudo a2enmod rewrite headers
This command will enable the rewrite and headers modules.
Step 6: Create a Database
Next, we need to create a database for File Sharing. Run the following command in the terminal:
mysql -u root -p
Enter your MySQL root password and then run the following SQL commands:
CREATE DATABASE filesharing;
GRANT ALL PRIVILEGES ON filesharing.* TO 'filesharing_user'@'localhost' IDENTIFIED BY 'filesharing_password';
This will create a database called filesharing and a user called filesharing_user with the password filesharing_password.
Exit the MySQL console by typing exit.
Step 7: Set Up Configuration File
The next step is to set up the File Sharing configuration. Copy the config.example.php file to config.php using the following command:
cp config.example.php config.php
Open the config.php file using your favorite text editor:
nano config.php
Set the following values:
'env' => 'production',
'database' => [
'host' => 'localhost',
'port' => 3306,
'database' => 'filesharing',
'username' => 'filesharing_user',
'password' => 'filesharing_password',
],
'url' => 'http://localhost/filesharing',
Save the changes and exit.
Step 8: Set Permissions
In this step, we need to set the appropriate permissions on the storage directory. Run the following commands:
sudo chown -R http:http storage
sudo chmod -R 775 storage
This will set the ownership of the storage directory to the Apache user and group and set the permissions to allow read and write access.
Step 9: Restart Apache
The final step is to restart Apache to apply the changes we made. Run the following command:
sudo systemctl restart httpd
Conclusion
Now that you have installed File Sharing, you can access it by opening your browser and navigating to http://localhost/filesharing. You should see the File Sharing dashboard, where you can manage your files and folders.