Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Apr 15, 2025

Ubuntu : Nginx Proxy Manager (NPM)

Nginx Proxy Manager (NPM) is a user friendly, open source tool that simplifies the management of Nginx Reverse Proxy configurations. It have a Web UI for creating and managing Proxy Hosts, SSL Certificates and User Management and Permissions.

NPM makes managing services exposed to the Internet easily and securely. For easy installation and consistent environment, NPM runs on Docker.

Let's Get Started !

1. Install Docker's GPG Key.

sudo apt install ca-certificates curl gnupg -y


2. Modify the permission for "keyrings".

sudo install -m 0755 -d /etc/apt/keyrings


3. Download Docker's GPG Key.


sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc



4. Grant required permissions.

sudo chmod a+r /etc/apt/keyrings/docker.asc


5. Add Docker to the Repository.

echo \


"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \



$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \


sudo tee /etc/apt/sources.list.d/docker.list > /dev/null


6. Update the Repository.

sudo apt update


7. Install Docker.


sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y



8. Test Docker installation.

sudo docker run hello-world


9. Enable and Start Docker.

sudo systemctl enable docker

sudo systemctl start docker


10. Add "docker" to User group.

sudo usermod -aG docker $USER


11. Install Docker Compose.


sudo curl -SL https://github.com/docker/compose/releases/download/v2.34.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose



12. Modify Docker Compose Permission.

sudo chmod +x /usr/local/bin/docker-compose


13. Test the Docker Compose.

sudo docker-compose


14. Create a installation folder for Nginx Proxy Manager.

sudo mkdir ~/nginx-proxy


15. Change directory into the newly created folder.

cd ~/nginx-proxy


16. Create sub-folders inside "nginx-proxy" folder.

sudo mkdir {data,letsencrypt}


17. Create Docker Compose file inside "nginx-proxy" folder.

sudo nano docker-compose.yml


18. Copy and Paste the following codes into the file. You might want to check for the latest configuration at (https://nginxproxymanager.com/setup/#using-mysql-mariadb-database)


services:
    app:
        image: 'jc21/nginx-proxy-manager:latest'
        restart: unless-stopped
        ports:
            # These ports are in format <host-port>:<container-port>
            - '80:80' # Public HTTP Port
            - '443:443' # Public HTTPS Port
            - '81:81' # Admin Web Port
            # Add any other Stream port you want to expose
            # - '21:21' # FTP
        environment:
            # Mysql/Maria connection parameters:
            DB_MYSQL_HOST: "db"
            DB_MYSQL_PORT: 3306
            DB_MYSQL_USER: "npm"
            DB_MYSQL_PASSWORD: "npm"
            DB_MYSQL_NAME: "npm"
            # Uncomment this if IPv6 is not enabled on your host
            # DISABLE_IPV6: 'true'
        volumes:
            - ./data:/data
            - ./letsencrypt:/etc/letsencrypt
        depends_on:
            - db

    db:
        image: 'jc21/mariadb-aria:latest'
        restart: unless-stopped
        environment:
            MYSQL_ROOT_PASSWORD: 'npm'
            MYSQL_DATABASE: 'npm'
            MYSQL_USER: 'npm'
            MYSQL_PASSWORD: 'npm'
            MARIADB_AUTO_UPGRADE: '1'
        volumes:
            - ./mysql:/var/lib/mysql



19. Create Docker Network for Nginx Proxy Manager.

sudo docker network create npm-nw


20. Start Nginx Proxy Manager.

sudo docker-compose up -d


21. Check the Docker Status.

sudo docker ps


22. Open favorite browser (eg. Google Chrome) and browse the following address. You should be able to see a Nginx Proxy Manager Welcome Page.

http://[IP Address]


23. Now login to Nginx Proxy Manager Admin Web UI, please note the port number is 81.

http://[IP Address]:81


24. Login with the default Username and Password as below.


Default Username    : admin@example.com

Default Password    : changeme



25. After successfully login, you will be prompted to change the Username and Password, please proceed to change it accordingly and remember the new Username and Password.



!!! HAPPY COMPUTING !!!

Mar 14, 2025

[UPDATE] Crypto : Duino Coin

[UPDATE] CRYPTO : DUINO COIN.

An updated tutorial on how to mine Duino Coin (DUCO) on an Android Mobile Device. For more information please refer to my previous post (https://danielcheah.blogspot.com/search/label/Duino-Coin)

This new method have been successfully tested on the latest version of Termux and Ubuntu-in-Termux system.


(A) INSTALL F-DROID.
  1. Download and Install F-Droid Store (https://f-droid.org/en/)
  2. You need to allow installation from "Unknown Sources" option.
  3. Once installed, open F-Droid Apps.
  4. It will automatically update its own repositories, wait for it to complete.

(B) INSTALL TERMUX (TERMINAL EMULATOR).
  1. Inside F-Droid Store, search for --> Termux (Terminal Emulator).
  2. Download and install it.
  3. You need to allow installation from "Unknown Sources" option.

(C) INSTALL UBUNTU IN TERMUX.
  1. pkg upgrade
  2. pkg install wget
  3. pkg install proot
  4. pkg install git
  5. termux-setup-storage     # Allow the access when prompted.
  6. git clone https://github.com/MFDGaming/ubuntu-in-termux.git
  7. cd /ubuntu-in-termux
  8. chmod +x ubuntu.sh
  9. ./ubuntu.sh     #wait for the installation to complete.
  10. ./startubuntu.sh

(D) INSTALL DUINO MINER IN UBUNTU.
  1. apt update && apt upgrade -y
  2. apt install wget -y
  3. apt install proot -y
  4. apt install git -y
  5. apt install python3 -y
  6. apt install python3-pip -y
  7. apt install python3-dev -y
  8. git clone https://github.com/revoxhere/duino-coin.git
  9. cd duino-coin
  10. pip install requests --break-system-packages
  11. pip install colorama --break-system-packages
  12. pip install py-cpuinfo --break-system-packages
  13. pip install psutil --break-system-packages
  14. pip install pypresence --break-system-packages

* Note : The option "--break-system-packages" is only required should you encountered any error during "pip" installations. Thus run the command without these option first.

* Note : If you still encountered errors, try install full Python3 by using "apt install python3-full" method.


(E) START DUINO MINER.
  1. python3 PC_Miner.py
  2. You will be prompted to key-in your Duino e-Wallet Username & Mining Key.
  3. You will be prompted to select the Intensity, Cores and Donation level.
  4. You can also specify the Miner's Hostname when prompted.
  5. Wait for 1-2 minutes and the new miner will be reflected in your Duino e-Wallet website.

EDIT : 4-Apr-2025
For Ubuntu Server v.24.04.1 LTS or later. For some unknown reasons, either due to latest Python3 version or due to latest Duino v.4.3 version, it seems to the below command will works.

1. sudo pip3 install requests --break-system-packages
2. sudo pip3 install colorama --break-system-packages
3. sudo pip3 install py-cpuinfo --break-system-packages
4. sudo pip3 install psutil --break-system-packages
5. sudo pip3 install pypresence --break-system-packages

OR

1. sudo python3 -m install requests --break-system-packages
2. sudo python3 -m install colorama --break-system-packages
3. sudo python3 -m install py-cpuinfo --break-system-packages
4. sudo python3 -m install psutil --break-system-packages
5. sudo python3 -m install pypresence --break-system-packages



!!! HAPPY COMPUTING !!!


Jan 2, 2025

Nomodeset : Proxmox and Ubuntu

At times where the connected Monitor or Graphics card are unable to support certain resolution, either the wordings is too small to read or overly large making some info or buttons unable to be seen.

A simple fix is to "edit" the grub boot file and this can be done on-the-fly easily.


1. During the boot-up, select the appropriate install option and Press [E] to edit the boot-up configuration.


2. Append the "nomodeset" word at the end of the following line.

for Proxmox :-
linux     /boot/linux26 ro randisk_size=16777216 rw quiet splash=silent proxtui vga=788 nomodeset

for Ubuntu :-
linux - /boot/vmlinuz-4.4.0-41-generix.efi.signed root=UUID=7x357f9a-47e7-946e-499eBee8adic ro quiet splash nomodeset svt_handoff


3. Proceed to save and exit the configuration file, Press [CTRL] + [X].



If you want the changes to be permanent after installation completed, you will need to modify "GRUB" file with the same option.

4. Edit the "GRUB" configuration file.
sudo nano /etc/default/grub


5. Append the "nomodeset" as shown below.
GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"


6. Update the "GRUB" configuration.
sudo update-grub


7. Finally reboot the server for the new configurations to take effects.


!!! HAPPY COMPUTING !!!

Nov 27, 2024

AntMedia Server : Install and Configure in Ubuntu Server

AntMedia Server (AMS) is an Open-Source, Self-Hosted Video Streaming Platform. It supports steaming of pre-recorded videos to supported website such as Youtube, Twitch, HTML etc.

For more information, visit their official website at (https://antmedia.io/)


1. Ensure that you already have Ubuntu installed and updated with the latest packages. Also you need to have Apache2 web server pre-installed, up and running.


2. First, download the latest version of AntMedia Server Community Edition.


sudo wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.11.3/ant-media-server-community-2.11.3.zip



3. Next is to download Installer Script file from AntMedia.


sudo wget -O install_ant-media-server.sh https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh



4. Now change the installer file to executable format.

sudo chmod +x install_ant-media-server.sh


5. To install the Community Edition, run the following command.

sudo ./install_ant-media-server.sh -i ant-media-server-community-2.11.3.zip


6. Configure the Apache Web Server.

sudo nano /etc/apache/sites-available/[domain.com].conf

Add the following configuration


<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName [domain.com]

   ErrorLog /var/log/apache2/[domain.com]/error.log
   CustomLog /var/log/apache2/[domain.com]/access.log

   ProxyRequest off
   ProxyPass / http://127.0.0.1:5080/
   ProxyPassReverse / http://127.0.0.1:5080/

</VirtualHost>



7. Enable Apache modules accordingly.

sudo a2enmod proxy proxy_http


8. Enable the new virtual site.

sudo a2ensite [domain.com].conf


9. Enable SSL for AntMedia Server.

cd /usr/local/antmedia

sudo ./enable_ssl.sh -d [domain.com]


10. Ensure the following ports is accessible to the server.

Port Number

Protocol

Descriptions

80

TCP

SSL

5080

TCP

HTTP

5443

TCP

HTTPS

4200

UDP

SRT

1935

TCP

RTMP

50000 - 60000

UDP

WebRTC

5000

TCP

Multi-Nodes Cluster (optional)



11. Restart Apache Server.

sudo systemctl restart apache2


12. Open your favorite browser (eg. Google Chrome), browse the following URL.

http://[domain.com]:5080


13. Once the page have been loaded, you will be prompted to create the first administrator account. Procced to create the admin account and login afterward.


Added tutorial video.





!!! HAPPY COMPUTING !!!

Nov 18, 2024

NextCloud Install in Ubuntu Server

NextCloud is an Open Source, Self-Hosted or Cloud Hosted, File Sync and Sharing Platform. It's Secure, Private and Easy to use. Compatible with Windows, Linux, Android and Apple iOS devices.

This is assuming that you already have Ubuntu Server installed, patched and updated.

1. Download the latest version of NextCloud.

sudo wget https://download.nextcloud.com/server/releases/latest.zip


2. Install some required packages.


sudo apt install libmagickcore-6.q16-6-extra php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml -y



3. Install Marid DB Server.

sudo apt install mariadb-server -y


4. Secure Marid DB installation, follow on-screen prompt and instructions.

sudo mysql_secure_installation


5. Configure Maria DB Server.


CREATE DATABASE nextcloud;

SHOW DATABASES;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'ncuser'@'localhost' IDENTIFIED BY 'ncpass';

FLUSH PRIVILEGES;

QUIT;



6. Enable PHP Modules.

sudo phpenmod apcu bcmath gmp imagick intl


7. Install Unzip Apps.

sudo apt install unzip -y


8. Unzip the downloaded NextCloud file.

sudo unzip latest.zip


9. Copy and Rename the extracted NextCloud folder.

sudo cp nextcloud demo.com


10. Move the renamed folder to Apache server path.

sudo mv demo.com /var/www/


11. Grant permissions to NextCloud folder.

sudo chwon -R www-data:www-data /var/www/demo.com


12. Create Apache configuration file for NextCloud.


<VirtualHost *:80>
   ServerAdmin webmaster@local.com
   ServerName demo.com
   DocumentRoot /var/www/demo.com

   <Directory /var/www/demo.com>
     Options MultiViews FollowSymlinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>

   ErrorLog /var/log/apache2/demo.com/error.log
   TransferLog /var/log/apache2/demo.com/access.log

  <IfModule mod_headers.c>
     Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
   </IfModule>

</VirtualHost>



13. Configure and modify PHP file. Modify the value according to your requirements.


memory_limit = 512M

upload_max_filesize = 512M

max_execution_time = 360

post_max_size = 512M

date.timezone = Asia/Kuala_Lumpur

opcache.enable = 1

opcache.interned_strings_buffer = 16

opcache.max_accelerated_files = 10000

opcache.memory_consumption = 128

opcache.save_comments = 1

opcache.revalidate_freq = 1



14. Enabled Apache modules for NextCloud use.

sudo a2enmod dir env headers mime rewrite ssl


15. Enable APCU module in PHP.

sudo nano /etc/php/8.3/mods-available/apcu.ini

add the following line :-

apc.enable_cli = 1


16. Open your favorite browser, such as Google Chrome browser. And type the URL of NextCloud server (eg. http://demo.com). At the main screen, you need to configure the NextCloud Database (eg. nextcloud) created earlier including its username (eg. ncuser) & password (eg. ncpass). You also need to create the First Administrator account with a valid email address too.


17. NextCloud screen will auto refresh upon successful connection to the database, now login with the new administrator account created in earlier step.


18. Secure NextCloud with Let's Encrypt SSL.

sudo certbot --apache


19. Fix missing Indices in NextCloud.

sudo chmod +x /var/www/demo.com/occ

sudo /var/www/demo.com/occ db:add-missing-indices

sudo chmod -x /var/www/demo.com/occ


20. Change permissions of NextCloud config file.

sudo chmod 660 /var/www/demo.com/config/config.php

sudo chown root:www-data /var/www/demo.com/config/config.php


21. Modify NextCloud configuration file.

sudo nano /var/www/demo.com/config/config.php

Modify the following lines according to you needs :-


'memcache.local' => '\OC\Memcache\APCu',

'default_phone_region' => 'MY',

'maintenance_window_start' => 1,

'filelocking.enabled' => true,

'memcache.locking' => '\OC\MemCache\APCu',



22. Restart Apache server.

sudo systemctl restart apache2


23. Configure Crontab.

sudo crontab -u www-data -e

Add the following line :-

00 * * * 1 php -f /var/www/demo.com/cron.php



OPTIONAL STEPS

24. Remove Skeleton Files and Folders when User account is created.

sudo rm -R /var/www/demo.com/core/skeleton/Templates


25. Remove Work Flow Engine, to prevent User from installing WorkFlow.


sudo /var/www/demo.com/occ config:app:set workflowengine user_scope_disabled --value yes



26. Install "Redis" as MemCache for NextCloud.

sudo apt install redis php-redis -y

sudo systemctl enable redis

sudo systemctl start redis

sudo nano /var/www/demo.com/config/config.php


'memcache.local' => '\OC\Memcache\Redis',

'memcache.locking' => '\OC\Memcache\Redis',

'redis' => array(
     'host' => '/var/run/redis/redis.sock'.
     'port' => 0,
     'timemout' => 0.0,
     ),


sudo nano /etc/redis/redis.conf


unixsocket /var/run/redis/redis.sock

unixsocketperm 660


sudo usermod -aG redis www-data

sudo systemctl restart redis


27. If Redis is distributed, add following line into NextCloud config file :-

'memcache.distributed' => '\OC\Memcache\MemCached',


28. To clear all NextCloud log entries.

sudo -u www-data truncate /var/www/demo.com/data/nextcloud.log --size=0



!!! HAPPY COMPUTING !!!


Jul 29, 2024

Ubuntu : Install Samba Server

How to install Samba Server in Ubuntu Server v.22.04.4

1. As usual, update Ubuntu's repositories.

sudo apt update && sudo apt upgrade -y


2. Install the Samba server.

sudo apt install samba -y


3. To verify the Samba installation.

sudo whereis samba

OR

sudo samba -v

OR

sudo systemctl status smbd


4. Make a backup of Samba's configuration file.

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak


5. Edit the Samba's configuration file.

sudo nano /etc/samba/smb.conf


6. Browse to the end of the file and add in the following configurations.

[global]
   server string = [Hostname]

[samba_share]
   comment = Samba Shared Folder
   path = /mnt/samba_share
   browsable = yes
   writable = yes
   read only = no
   guest ok = no
   valid users = [Samba Username]




7. Assign the proper permissions to the shared folder.

sudo chmod -R 755 /mnt/samba_share


8. Create a new Samba user.

sudo smbpasswd -a [Username]
*Note : you will be prompted to key-in the user's password.


9. Enable the created User for Samba access.

sudo smbpasswd -e [Username]


10. Test the Samba configuration.

sudo testparm


11. Restart Samba service for the new configurations.

sudo systemctl restart smbd


12. Test the Samba connections using another computer and with the credentials created.


!!! HAPPY COMPUTING !!!

May 6, 2024

Ubuntu : NFS Server

 How to install Ubuntu NFS Server and basic configuration.

1. Install NFS Apps.

sudo apt install nfs-kernel-server -y


2. Create NFS shared folder.

sudo mkdir /var/nfs/pve -p


3. Grant Ownership to newly created folder.

sudo chown -R nobody:nogroup /var/nfs/pve


4. Grant Permissions to newly created folder too.

sudo chmod 777 /var/nfs/pve


5. Edit NFS configurations.

sudo nano /etc/exports

Add or modify the following lines according to your needs:

/var/nfs/pve [IP Address/CIDR](rw,sync,no_subtree_check,no_root_squash)
example : /var/nfs/pve 192.168.0/24(rw,sync,no_subtree_check,no_root_squash)


6. Restart NFS service to take effects.

sudo systemctl restart nfs-kernel-server


!!! HAPPY COMPUTING !!!

Mar 11, 2024

Ubuntu : Install Piwigo Server

Piwigo is an Open Source Photo Management Server, it allows you to self-host your very own photo management, organizing and share your photo easily on the web.

More information about Piwigo can be found at (https://piwigo.org)

Let's get started.....


1. As always, ensure that your Ubuntu Server is up-to-date.

sudo apt update && sudo apt upgrade -y


2. Next is to install the Web Server, Database Server and some utilities.

sudo apt install apache2 libapache2-mod-php mariadb-server unzip curl imagemagick -y


3. We also need to install the following dependencies.

sudo apt install php php-common php-intl php-mysql php-gd php-xml php-ldap php-zip php-mbstring php-xmlrpc php-cli php-curl -y


4. After installation completed, we need to modify the PHP Configurations.

sudo nano /etc/php/8.1/apache2/php.ini

Inside the "php.ini" configuration file, look for the following settings and modify it accordingly.

memory_limit = 256M

upload_max_filesize = 200M

post_max_size = 200M



5. Then restart the Apache2 Server.

sudo systemctl restart apache2


6. Now, we need to create the Database for Piwigo to work, just press [ENTER] key when prompted for password.

sudo mysql -u root -p

Follow the below to create the database.

CREATE DATABASE piwigo_db;

CREATE USER 'piwigo_user'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON piwigo_db.* TO 'piwigo_user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH PRIVILEGES;

QUIT;



7. Download the latest Piwigo version.

sudo curl -o piwigo.zip https://piwigo.org/download/dlcounter.php?code=latest


8, After download complete, extract the zip file to the web server.

sudo unzip piwigo.zip -d /var/www/html


9. Next is allow the appropriate credentials for the Piwigo folder.

sudo chown -R www-data:www-data /var/www/html/piwigo/

sudo chomod -R 755 /var/www/html/piwigo/


10. Next is to create the Apache configuration file.

sudo nano /etc/apache2/sites-available/piwigo.conf

Create the configuration file as per below.

<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName piwigo.localhost
   DocumentRoot /var/www/html/piwigo
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

   <Directory /var/www/html/piwigo/>
       Options FollowSymlinks
       AllowOverride All
       Require all granted
   <\Directory>
<\VirtualHost>


11. Then we need to enable the newly created site.

sudo a2ensite piwigo.conf


12. We also need to enable Apache module as below.

sudo a2enmod rewrite


13. Finally we need to restart Apache Server.

sudo systemctl restart apache2


14. Once done, open any preferred browser and browse to Piwigo site.

http://[IP Address]/piwigo


15. You will need to perform initial configurations of piwigo, enter all the relevant information as required. This includes the Database Name and Credentials, also you will need to create an administrator user (to manage the Piwigo) which are not "Root".


16. Once everything are successfully configured, you will be able to login to the Piwigo site and you can start to create your first album and start uploading photos.

Note : It is recommended to install a Plugin called "Community" which allows your "Users" to create their own albums and upload photos.





!!! HAPPY COMPUTING !!!

Feb 1, 2024

ProjectSend : Self-Hosted Large File Sharing Server

Most companies now days needs a way to share large file(s), whether the intended recipient is a Customer, Supplier or among the Employees itself.

Most have known that there is a limitation on Email's attachment, the file size solely depends on which Email Provider you are using. The most common would be Microsoft Exchange, Exchange Online, Microsoft 365, Google Enterprise (aka Workspace) and many more. All these services have a limitation of email attachment, for example; Exchange Online have a limit of a maximum of 150MB size only.

What if you wanted to send larger file size, let's say an AutoCAD or Photoshop file ? These file can be very large depending on the contents.

While there are so called "FREE" large file sharing services available, but these services also have some limitations. These includes the lacks of tracking, security and reporting, some may also needs you to register for an account before using.

Do you really trust them with your information ??? 😏

Furthermore there is also limit on the storage of how many file(s) or folder(s) you wanted to share and for how long you can to keep it.

Thus it make sense that we need to self-host a file sharing server with the following conditions :-
  • The sharing have custom expiry date.
  • Only intended recipient(s) able to download or access it.
  • Able to notify the recipient(s) via email.
  • Able to track how many times the file(s) was downloaded.
  • Able to track who is the sharer or uploader.
  • And lastly, the ability to have logs for auditing purposes.
So, today I will be showing you the installation of yet another Open Source Software, called ProjectSend. If you find this software useful, please donate to them. Your donation will ensure they are able to continue to develop the software.

Let's start ...


1. As always, ensure you have Ubuntu Server v.22.04.3 installed and updated.

sudo apt update && sudo apt upgrade -y


2. Next is to install a Web Server and a Database Server.

sudo apt install apache2 mariadb-server -y


3. We also need to install other pre-requisites.

sudo apt install imagemagick php libapache2-mod-php php-imagick php-common php-mysql php-gd php-json php-curl php-zip php-xml php-mbstring php-bz2 php-intl php-bcmath php-gmp unzip -y


4. Next is to modify the PHP configuration.

sudo nano /etc/php/8.1/apache2/php.ini

Modify the following accordingly, as per your needs in "RED" text below.

memory_limit = 512M
upload_max_filesize = 10240M
max_execution_time = 600
post_max_size = 512M
date.timezone = Asia/Kuala_Lumpur


5. Now we need to secure our database server first.

sudo mysql_secure_installation

You will be prompted with the following questions, please answer as per your needs in "RED" text below.

Enter current password for root (enter for none): [PRESS ENTER]
Set root password? [Y/n]: Y
New password: [Key-In Password]
Re-enter new password: [Repeat password]
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y


6. Then we can create the database for this software.

sudo mysql -u root -p

You will be prompted to login, type-in the password you have created earlier. And follow the below commands to continue. You may replace the "RED" text as you deemed fits.

CREATE DATABASE projectsend;

CREATE USER 'projectsenduser'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON projectsend.* TO projectsenduser@localhost;

FLUSH PRIVILEGES;

QUIT;


7. Now, we need to download the latest ProjectSend file, as at time of writing the latest version was located in sub-folder "614", as such the newer version may have new sub-folder. Always check their website for the latest version and requirements.

sudo wget -O projectsend.zip https://www.projectsend.org/download/614/


8. Once download completed, unpack the file accordingly.

sudo unzip projectsend.zip -d /var/www/html/projectsend


9. Next is make a backup copy of ProjectSend's configuration file.

cd /var/www/html/projectsend/includes/

sudo cp sys.config.sample.php sys.config.php


10. Modify the configuration file accordingly, replace "RED" text according to you database created earlier.

define('DB_DRIVER', 'mysql');
/** Database name */
define('DB_NAME', 'projectsend');

/** Database host (in most cases it's localhost) */
define('DB_HOST', 'localhost');

/** Database username (must be assigned to the database) */
define('DB_USER', 'projectsenduser');

/** Database password */
define('DB_PASSWORD', 'password');

/** Define a maximum size (in mb.) that is allowed on each file to be uploaded.
define('MAX_FILESIZE',1024);


11. Assign to correct permissions accordingly.

sudo chown -R www-data:www-data /var/www/html/projectsend

sudo chmod -R 775 /var/www/html/projectsend

sudo chmod 644 /var/www/html/projectsend/includes/sys.config.php


12. Now we need to create configurations for Apache2.

sudo nano /etc/apache2/sites-available/projectsend.conf

Modify the configurations accordingly as per "RED" text below.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName projectsend.demo.com.my
    ServerAlias www.projectsend.demo.com.my
    DocumentRoot /var/www/html/projectsend/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/projectsend/>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>


13. Next is to enable Apache2's Rewrite module.

sudo a2enmod rewrite


14. Now we need to enable the new projectsend site.

sudo a2ensite projectsend.conf


15. Restart Apache2 server.

sudo systemctl restart apache2


16. On another computer, open any preferred browser (eg. Google Chrome) and browse to the following URL.

http://projectsend.demo.com.my

OR

http://[IP Address]

You will now be automatically prompted to create the "Administrator" credentials, proceed to key-in your preferred administrator's name and password accordingly. Click on the "INSTALL" button when done.

This may take a while, depending on your server's hardware specifications.


17. Since this server will be access from the Internet, it is recommended to secure the server. You might also want to consider installing "Fail2Ban" for extra security measures.

sudo ufw enable

sudo ufw allow http

sudo ufw allow https


18. Now we need to install Let's Encrypt certificate to make it more secure.

sudo apt install certbot python3-certbot-apache -y

sudo certbot --apache

You will be prompted for some information and selections, for SSL to works you need a valid email address. Also ensure that your Firewall or Router's Port Forwarding is configured correctly. The required port is 80 (HTTP) and 443 (HTTPS).

Enter email address (used for urgent renewal and security notices)
  (Enter 'c' to cancel): [Your Email Address]

Please read the Terms of Service at https://letsencrypt.org/LE-SA-v1.3-September-21-2022.pdf. You must agree in order to register with ACME server. Do you agree?
(Y)es/(N)0: Y

Would you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot ? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support freedom.
(Y)es/(N)o: N

When prompted for domain selection, you can select according to your needs. In this case I would select all domains by just pressing [ENTER] key to leave it blank.

Which names would you like to activate for HTTPS for?
----------------------------------------------------------------------------------------------------------------
1: projectsend.demo.com.my
2: www.projectsend.demo.com.my
----------------------------------------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): [Press Enter]


19. Finally, another restart of Apache2 server and your ProjectSend site is now with SSL.

sudo systemctl restart apache2


Edit : 18-Nov-2024, Uploaded Youtube Video.




!!! HAPPY COMPUTING !!!