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 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:
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 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.
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
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
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
Code: Select all
DirectoryIndex
index.html
index.cgi
index.pl
index.php
index.xhtml
index.htm
Code: Select all
DirectoryIndex
index.php
index.html
index.cgi
index.pl
index.xhtml
index.htm
And press Enter.
Then press Control + X to exit.
You have now installed PHP successfully.
4. 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}
Change "AllowOverride" from "None" to “All"
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
5. 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 have now installed CLI and CURL successfully.
6. 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
7. 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.*
8. 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.
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 Bitinvest.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 “bitlend".
Code: Select all
create database bitlend;
Now exit the window by typing the below command and press Enter.
exit
C. Import bitlend.sql 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/
Code: Select all
mysql -u root -p bitlend < bitlend.sql
11. Database Configuration
Goto .env folder using the following command:
Code: Select all
cd /var/www/html/
12. Check if index page and admin panel is working
www.yourdomain.com
www.yourdomainname.com/admin
Default Credentials ->
Username - admin
Pass - admin
You have installed the Bitcoin lending Script Successfully.