0% found this document useful (0 votes)
73 views13 pages

FansForX - Lite Installation - Document

This document provides a 21 step guide to install and configure Fanforx Lite on an Ubuntu 18.04 server. It includes instructions for setting up a secure user account, installing prerequisites like Apache, PHP, MySQL, and cloning the Fanforx code repository. The steps also cover configuring the database, .env file, and setting up a Tmux session for managing the server connection.

Uploaded by

jamesduval1983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views13 pages

FansForX - Lite Installation - Document

This document provides a 21 step guide to install and configure Fanforx Lite on an Ubuntu 18.04 server. It includes instructions for setting up a secure user account, installing prerequisites like Apache, PHP, MySQL, and cloning the Fanforx code repository. The steps also cover configuring the database, .env file, and setting up a Tmux session for managing the server connection.

Uploaded by

jamesduval1983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

FANFORX LITE

Prerequisites for Installation:

★ Terminal/Command prompt
★ Lamp install
★ Tmux
★ Project Setup

Note: Only for ubuntu 18.04 steps.


Server Installation Procedure

STEP 1:
Open the server without SSH-KEY using this command using password.

ssh root@DROPLET_IP_ADDRESS

Open the server with SSH-KEY using this command using the key.

ssh -i root-ssh-private-key root@DROPLET_IP_ADDRESS

It will prompt you for a password, enter the root password that was sent to your
mail, and press Enter. It will show details of your server and log you in.

STEP 2:
Now that you have logged into your server from the terminal, we’ll have to create
an alternate user account that you can use to access. From the logged in terminal,
type in the following command:

adduser DESIRED_USERNAME

STEP 3:
This would have created a User account. Now let’s add admin privileges to this
Account by typing the following command :

gpasswd -a USERNAME sudo

Please use the username you selected in STEP 6 for this.

STEP 4:
For creating a secure server, we have to create a security key for your local machine.
Let’s do that by Opening a new terminal window(Terminal 2) and typing in the
following command:

ssh-keygen

Once you type this command, It will prompt you for a question, Hit Enter without
typing anything. It will ask again for a passphrase, Hit Enter without typing
anything. Now your key is created.

STEP 5:
Now we’ll have to copy the key. To display the key, type in this command:

cat id_rsa.pub

Id_rsa - Whatever you gave the ssh key name.

The key will be a long sequence. Once the key is displayed, select it and copy it
using your Mouse or cursor.

STEP 6:
Let’s add this public key to our user (switch to TERMINAL 1) by typing in the
following commands in sequence :

su - USERNAME
mkdir .ssh
chmod 700 .ssh
nano .ssh/authorized_keys

This will open up a blank file in your Server terminal. Paste the copied ssh key in
this and press “ctrl/cmd+x”, it will prompt a question. Type Y and press enter again.

chmod 600 .ssh/authorized_keys


exit
To not allow default root login and secure the server ssh daemon, type in the
following command from logged in Terminal 1 from the root folder :

nano /etc/ssh/sshd_config
STEP 7: (Optional)

This will open up the file. Now search for the line “PermitRootLogin Yes” and
change it to “PermitRootLogin no” . Once this is done, let’s restart the ssh service
by typing in this command:

service ssh restart

STEP 8:
Now let’s close up all our terminals, Open a fresh new Terminal and try connecting
to the server.

ssh -i ssh-key USERNAME@DROPLET_IP_ADDRESS

(Example)

ssh -i id_rsa USERNAME@DROPLET_IP_ADDRESS

Access the server without ssh key.,

ssh USERNAME@DROPLET_IP_ADDRESS

Type in your password and you’ll be logged in as the new User.

STEP 9:
Now we’ll have to install apache for our servers to run. We can do that by typing
these commands in the terminal after logging in as the new user.

sudo apt-get update


sudo apt-get install apache2
Type in your password when it asks for it. Let each command run and take it’s time.

STEP 10:
To verify if it’s working or not, you can just open your browser and type in the
droplet IP address as the url and check if the Apache Ubuntu page is shown. Now,
let’s install our database MySQL. Type in the following command from the terminal:
sudo apt-get install mysql-server
sudo mysql_secure_installation

The command line will prompt you for questions if any like MySQL passwords, etc.,
You can either change them or just hit Enter to continue with the installation.

For our script to work, we need a php script to run. So let’s install PHP on our server
with the most needed Mcrypt plugin. Type in the following command:

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.4


sudo apt install php7.4-common php7.4-mysql php7.4-xml
php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli
php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap
php7.4-zip php7.4-intl -y php7.4-fpm php7.4-redis

Change the Upload limits php.ini file

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

max_execution_time=-1

max_input_time=-1

memory_limit -1

post_max_size =3000M

upload_max_filesize = 2048M

STEP 11:
Now that php is installed, we want our server to look for Index.php first than
index.html in order. So let’s change that by opening up this server file. Type in the
following command:

sudo nano /etc/apache2/mods-enabled/dir.conf

This will open up a file that has information like this.

<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
index.htm
</IfModule>

Change it to, cut the index.php and paste the before index.html

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml
index.htm
</IfModule>

STEP 12:
Let’s restart the service and check to see if the process has gone correctly. Type in
the command :

sudo service apache2 restart

And that’s it for installing PHP,MySQL and apache.

STEP 13:
Let’s set up phpMyAdmin now for accessing our Databases. Type in the command in
the terminal :

sudo apt-get install phpmyadmin php-mbstring php-gettext

This will prompt a few questions to make the installation correctly. When the first
prompt appears, Hit “SPACE”, then “TAB” and “Enter” . After this, you will be
asked for a database administrator’s password. Next, you will be able to choose
and confirm a password for the phpMyAdmin application itself.

STEP 14:

sudo a2enmod php7.4

sudo service apache2 restart

STEP 15:
Open the apache conf file . Eg: sudo nano /etc/apache2/apache2.conf

Change the following lines.

<Directory />
Options FollowSymLinks
AllowOverride None -> Change None to All
Require all denied
</Directory>

<Directory /usr/share>
AllowOverride None -> Change None to All
Require all granted
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None -> Change None to All
Require all granted
</Directory>

Update the end of the file in this command. After saving the
apache2.conf file, restart apache2.

Include /etc/phpmyadmin/apache.conf

sudo service apache2 restart


Now you can access phpMyAdmin by typing in your web browser URL
“http://IP_ADDRESS/phpmyadmin”. Once the page opens, you will be asked for a
username and password. Use “root” for username and the password you set during
phpMyAdmin installation for password and login. You will be able to create/delete
databases in your server now.

As of now, all the basic requisites are installed in our server including, php, Mcrypt,
MySQL, phpMyAdmin and we have set up a user account for secure access from our
local machine.

STEP 16:
Download the fansforx package zip file and copy the file to the server. Now we
have to put this code in our server that we have set up till now. Since we added a
secure user and secure access to our server, we don’t have to use a separate FTP
client, we can use a secure copy method. Open a new terminal, do not log in to the
server, just type this command :
scp -r -i id_rsa(ssh-key path) PATH_FOR_FANSFORX_LITE_PACKAGE
USERNAME@DROPLET_IP:/home/USERNAME

id_rsa - whatever you create a ssh key that private key path name

Note : “Path for fansforx lite packages” means the path your downloaded package
is, eg: C:/Users/PC name/Downloads/fansforx-lite.zip
After this, You will have the fansforx lite zip file in your server. Unzip the both files
for using this command.

sudo apt-get install unzip

unzip fansforx-lite.zip

STEP 17:
You will get 1 different folder

1) fansforx-lite

fansforx Lite It contains a user and admin panel.


Once this command is typed, it will ask you for the password, type in the password
and press enter to securely copy all the code into our server. First, Login to the
server using the ssh username@droplet_ip_address command and sublink all the
other folders to the root folder by typing in this command.

sudo ln -sf /home/USERNAME/fansforx-lite /var/www/html

STEP 18:

# Composer Installation: ( Optional )

Update the this command in your server for Username@droplet_name:~$

sudo apt-get install composer

cd fansforx-lite

composer update

STEP 19:

# TMUX Installation:

We’ll need to configure the tmux session. So that we can have multiple sessions on
the server. Let’s start configuring the tmux session.

wget https://aravinth.net/tmux.conf --no-check-certificate


mv tmux.conf ~/.tmux.conf

Open Nano by following link

sudo nano ~/.bashrc

Paste this in bottom of the File

tm() { tmux new -s "$1" ;}


ta() { tmux attach -t "$1"; }
tl() { tmux list-sessions; }

Run this command

source ~/.bashrc
tm session_name - Create New Session

List All Session

tl

Open already existing session

ta session_name

STEP 20:
We’ll have to create a database using phpMyAdmin. So open up a web browser,
Type in the URL field : http://IP_ADDRESS/phpmyadmin and Log in using the
username as root and the password you gave during installation.

After logging in, Click on the “Databases” tab, enter a desired database
name(Remember this database name) in the “create database” field and click on
create database to create an empty database.

Once you’ve created an empty database, Click on the “Import” tab and click on
“choose file” button. Now, locate the “fansforx.sql” database file inside the DB
folder from the downloaded package and import it into the empty database. You
can see a list of tables now on your left pane after import.

Mysql import command use this

mysql -u root -p database_name < path of mysql file (Eg:


/home/Username/fansforx-lite/DB/fansforx.sql)

STEP 21:
Now from the server logged in terminal, type this following command to go into the
fansforx-lite directory :

# .env File Configuration

cd fansforx-lite

Open up the .env file using this following command :

sudo nano .env

After opening up the file, find the following piece of code and give the correct
information.

DB_HOST= 127.0.0.1 (Provide Database host here, default host is 127.0.0.1)


DB_PORT=3306 (Provide Database port here, default port is 3306)
DB_DATABASE= (Provide the Database name that was created in STEP 28)
DB_USERNAME= (Database username provided during configuration)
DB_PASSWORD= (Database password provided during configuration)

APP_URL = (Update you admin panel URL here /)

STEP 22:
The database has been created with base tables and entries. For allowing access to
specific folders for databases, type in the following commands in sequence:

We need to give permission - navigate to /fansforx-lite/ - you can find


storage,public/uploads, bootstrap/cache. Give 777 permission.

sudo chmod -R 777 storage public/uploads bootstrap/cache .env

# Create symlink for uploads folder

cd fansforx-lite/
php artisan storage:link
STEP 23:

Project Setup:

Open log file in a new window

Check the storage->log -> inside laravel.log file. After use this command

tail -f storage/logs/laravel.log

Don’t close the tmux session queue, listen has to run in the background
continuously.
control + b d // To exit from tmux session without closing it.

STEP 24:

We’ll have to create a virtual host for fansforx lite base.

Open the virtual host in path

cd /etc/apache2/sites-available

Open the 000-default.conf and update the server name and document root -
backend configuration

sudo nano 000-default.conf

ServerName domain.com -> comments: remove # this

ServerAdmin webmaster@localhost -> comments: Update the your admin


email (optional)

DocumentRoot /var/www/html/fansforx-lite/public -> comments:


update the root directory

Save the 000-default.conf file.

After this process completes, do the following commands.


sudo a2enmod rewrite
sudo service apache2 restart

Here is the reference link to create a virtual host.

https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu
-18-04

STEP 25:

This completes the server setup and installation for fansforx. Now please open up a
browser and type in the URL : http://domain.com / http://ipaddress/ and login with
the default username and password.

Admin Login:

URL: http://domain.com/admin/login

Username : [email protected]

Password : demo123

User Login:

URL: http://domain.com/

Username: [email protected]

Password: demo123

You might also like