How to install the Cryptocurrency Comparison Script from BitExchange?

Post Reply
blockchainscripts
Site Admin
Posts: 184
Joined: Tue Apr 03, 2018 2:12 pm

How to install the Cryptocurrency Comparison Script from BitExchange?

Post by blockchainscripts »

BitCompare by BitExchange, the Cryptocomparison script allows you to start a Alt coins and bitcoin price tracking site with complete historical pricing and other details.

For convenience, we assume that you are installing the script on a Webfaction or a Digital Ocean server.

If you haven't purchased a Webfaction server ( get it here ) or Digital Ocean server ( get it here )

Step 1: Install Apache
The first step is to install Apache. Type the following commands in the terminal:

Code: Select all

sudo apt-get update
sudo apt-get install apache2
You will be prompted with a (Y/n). Type y and press Enter.

You can do a spot check right away to verify that everything went as planned by visiting your server's public IP address in your web browser.

http://your_server_IP_address
You will see the default Ubuntu 16.04 Apache web page, which is there for informational and testing purposes. It should look something like this:
defaultapache.jpg
defaultapache.jpg (107.96 KiB) Viewed 10363 times
If you see this default landing page, You have now installed Apache web server successfully.

2. Install MySQL

Now that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information.
Type in the following commands into the Terminal:

Code: Select all

sudo apt-get install mysql-server
You will be prompted with a (Y/n). Type y and press Enter.

You will be prompted to enter a password for MySql. Enter a secure password and press Enter. Save this password. You will need this to login to your database.

Image

You have now installed MySql database successfully.
Open the mysql conf file to rewrite port number with the following command.

Code: Select all

sudo nano /etc/mysql/mysql.conf.d/mysql.conf
Change the bind-address from the default value of 127.0.0.1 to 0.0.0.0

bind-address = 0.0.0.0

3. Install PHP 7.0

PHP is the component of our setup that will process code to display dynamic content. It can run scripts, connect to our MySQL databases to get information, and hand the processed content over to our web server to display.
Step 1: Install PHP to server Type the following commands into the terminal:

Code: Select all

sudo apt-get install php7.0 libapache2-mod-php php-mcrypt php-mysql php-gd php-bcmath
You will be prompted with a (Y/n). Type y and press Enter.

This should install PHP without any problems.
Change the location of index.php
To do this, type this command to open the dir.conf file in a text editor with root privileges:

Code: Select all

sudo nano /etc/apache2/mods-enabled/dir.conf
Inside of the file will look like this:

Code: Select all

DirectoryIndex 
index.html 
index.cgi 
index.pl 
index.php 
index.xhtml 
index.htm
We want to move the index.php file above to the first position after the DirectoryIndex, like this:

Code: Select all

DirectoryIndex 
index.php 
index.html 
index.cgi 
index.pl 
index.xhtml 
index.htm
When you are finished, Press Control + O to save.
And press Enter.
Then press Control + X to exit.
You have now installed PHP successfully.

4. Enable short_open_tags
Open the php.ini file with the following command:

Code: Select all

sudo nano /etc/php/7.0/apache2/php.ini
Scroll down and search for a line with text "short_open_tags = off" and change the status from "off" to "on".
bitcom3.jpg
bitcom3.jpg (68.25 KiB) Viewed 10358 times
short_open_tags = on
Save this file by pressing Control + O.
Press Enter.
Close this close by pressing Control + X.

5. Enabling pretty URLs
Next, we need to enable pretty URLs by the following commands:

sudo a2enmod rewrite
nano /etc/apache2/apache2.conf

Press the down arrow until you reach {Directory /var/www}
bitcom4.png
bitcom4.png (74.25 KiB) Viewed 10358 times
Change "AllowOverride" from "None" to “All"
bitcom5.png
bitcom5.png (75.6 KiB) Viewed 10357 times
Press Control + O to save. And press Enter. Then press Control + X to exit.

Restart the apache server by entering the following command in your terminal.

sudo service apache2 restart

6. Install CLI and CURL

To do this, type the following command into your Terminal:

Code: Select all

sudo apt-get install php-cli php-curl curl
You will be prompted with a (Y/n). Type y and press Enter.

You have now installed CLI and CURL successfully.

7. Install Composer

Type the following command into your Terminal to install Composer globally:

Code: Select all

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin —filename=composer
You have now installed Composer successfully.

8. Install Laravel 5.4


Type the following command into your Terminal to install Laravel:

Code: Select all

composer create-project --prefer-dist laravel/laravel blog “5.4.*
Laravel will get installed successfully.

9. Uploading source code to server

This section shows us how to upload the source code for the exchange to the server we've setup. We will be using FileZilla to upload the code with FTP as it is the easiest way for managing file transfers.

Download FileZilla and install it on your system.

Open FileZilla and go to FileZilla>Settings.

Go to SFTP tab.
bitcom6.png
bitcom6.png (123.41 KiB) Viewed 10357 times
Press Add key file and select your SSH private key.
You will be prompted to enter your SSH key password. Once the key is added, press OK.

Now, enter sftp://ip_address of the droplet you want to connect in the Host field and give Username as root. Press Quickconnect to establish connection.

The left panel is your local directory and the right panel is the directory in your server. Now drag the cryptocompare.zip you have downloaded and drop it to /var/www/html/ folder.

You have now successfully uploaded the code to the server.

10. Setting up Database


a. Login to MySQL
Enter the following command to login to MySQL database and press Enter.

sudo mysql -u root -p

Type your MySQL password you have given in Step 3 on prompt.

b. Create a database

Create a database with the below command. For this example I have given the name “cryptocompare".

Code: Select all

create database cryptocompare;
You have created a database by the name cryptocompare.
Now exit the window by typing the below command and press Enter.
exit

C. Import SQL file into your database

Navigate to the admin directory by typing the below command in the Terminal and press Enter.

Code: Select all

cd /var/www/html/
Then type the import command to import the SQL file into your database (i.e : cryptocompare)

Code: Select all

mysql -u root -p cryptocompare < cryptocompare.sql 
Hit Enter to execute the command and type your MySQL password you have given in Step 3 on prompt.

11. Database Configuration

Goto .env folder using the following command:

Code: Select all

cd /var/www/html/
And configure the database name, username, password which you have given in step 3.

12. Base Controller Configuration

Goto controllers folder and open BaseController.php file

Code: Select all

cd /app/Http/Controllers/
sudo nano BaseController.php 
Change the Base URL - http://www.yourdomainname.com/cryptocompare

Change Image Base Url - http://www.yourdomainname.com/public

If you have SSL certificate installed, then change http to https here.
bitcomp8.jpg
bitcomp8.jpg (43.47 KiB) Viewed 10357 times
12. Check if index page and admin panel is working

www.yourdomain.com

www.yourdomainname.com/admin-login

Default Credentials ->

Username - [email protected]
Pass - 12345

You have installed the Cryptocurrency Comparison Script Successfully.
Attachments
bitcomp.jpg
bitcomp.jpg (43.48 KiB) Viewed 10362 times
Post Reply

Return to “Installation Guide”