FansForX - Lite Installation - Document
FansForX - Lite Installation - Document
★ Terminal/Command prompt
★ Lamp install
★ Tmux
★ Project Setup
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.
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 :
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
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.
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:
STEP 8:
Now let’s close up all our terminals, Open a fresh new Terminal and try connecting
to the server.
(Example)
ssh USERNAME@DROPLET_IP_ADDRESS
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.
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:
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:
<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 :
STEP 13:
Let’s set up phpMyAdmin now for accessing our Databases. Type in the command in
the terminal :
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:
STEP 15:
Open the apache conf file . Eg: sudo nano /etc/apache2/apache2.conf
<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
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.
unzip fansforx-lite.zip
STEP 17:
You will get 1 different folder
1) fansforx-lite
STEP 18:
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.
source ~/.bashrc
tm session_name - Create New Session
tl
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.
STEP 21:
Now from the server logged in terminal, type this following command to go into the
fansforx-lite directory :
cd fansforx-lite
After opening up the file, find the following piece of code and give the correct
information.
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:
cd fansforx-lite/
php artisan storage:link
STEP 23:
Project Setup:
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:
cd /etc/apache2/sites-available
Open the 000-default.conf and update the server name and document root -
backend configuration
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