Eckmar'S Marketplace Script Installation Instructions: Requirements
Eckmar'S Marketplace Script Installation Instructions: Requirements
Eckmar'S Marketplace Script Installation Instructions: Requirements
INSTALLATION INSTRUCTIONS
Requirements
● Linux VPS (Any Specifications)
● Bitcoind server
Setting Up VPS
First Login
When purchasing VPS you should get your login details. If you are on Linux or Mac you already
have SSH client install. If you are on Windows you will have to download a client like
PuTTY. After successful login first command that you should run is:
You will see a bunch of text, and eventually you will get your command prompt again.
Installing Nginx
In order to install Nginx you have to run only one command:
Installing MySQL
Shopkin support multiple database solutions (SQLite, Postgres etc.) but we’ll be using MySQL.
In order to get strated run:
1 sudo mysql_secure_installation
In order to secure your installation. If you decide to do so, just follow the on screen
instructions.
Installing PHP
PHP comes in the form of a plugin called php-fpm (FastCGI Process Manager). In order to
install php-fpm and other required plugins to make it work with Laravel and MySQL run:
After installation is complete you have to configure PHP. In your terminal, open up your php.ini
file in whatever text editor you wish (VIM, or eMacs) but for simplicity, we will use Nano:
Press Ctrl+W and now type in cgi.fix_pathinfo= and click enter. This will take you to the right line
right away. You will see a semicolon the left of this line. Delete the semi colon and then change
the 1 into a 0 and save the file.
Before the changes can take effect we need to restart php-fpm by typing in this command:
Configuring Nginx
All the configuration we need to make is in the following config file. Go ahead and open it up in
Nano using the following command (use another editor if you prefer).
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server;
4
5 root /var/www/html;
6 index index.html index.htm index.nginx-debian.html;
7
8 server_name _;
9
10 location / {
11 try_files $uri $uri/ =404;
12 }
13 }
14
In the line with all of the index names, we will add index.php to the list of allowed file types to
deliver by default. What this line tells Nginx is to first look for an index file, then look for an
index.php file, then an index.html file and so forth.
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server;
4
5 root /var/www/html;
6 Index index.php index.html index.htm index.nginx-debian.html;
7
8 server_name _;
9
10 location / {
11 try_files $uri $uri/ =404;
12 }
13 }
Next we need to add our public domain or IP address to the server_name line. This tells Nginx
the domain to respond to. I am going to use an IP address for this tutorial since I am not setting
up a domain. But if you have a domain name that you want this server to use then you would
put the domain name here instead.
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server;
4
5 root /var/www/html;
6 index index.php index.html index.htm index.nginx-debian.html;
7
8 server_name107.191.44.91;
9
10 location / {
11 try_files $uri $uri/ =404;
12 }
13 }
Now we need to do a few other housecleaning items. You will want to just trust me on these as
they get more complex, but the concepts of what they accomplish should make sense to you.
First things first we want to tell Nginx to use your php-fpm that we installed earlier. This will be
represented by the first location block that we add (it will actually be the second on in the
document though, make sure to leave the first location block alone (for now, we will come back
to configure it for Laravel later).
The second location block we are adding (the third in the file) will be telling Nginx to ignore
.htaccess files. This is because .htaccess files are for Apache and we are using Nginx.
Sometimes Laravel files will have .htaccess files in them by default so let’s just make sure that if
one gets onto our server to make sure it doesn’t interfere with anything and our users do not
have access to it.
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server;
4
5 root /var/www/html;
6 index index.php index.html index.htm index.nginx-debian.html;
7
8 Server_name IP OR DOMAIN HERE;
9
10 location / {
11 try_files $uri $uri/ =404;
12 }
13 location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
When your config file looks something like this, save it. After that, we need to check for errors by
running:
1 sudo nginx -t
If everything was correct then you should get this notice when submitting the command:
This means you have no errors. In order for changes to take effect run:
Now, we need to edit our nginx config again to make it point to our folder:
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server;
4
5 root /var/www/shopkin/public;
6 index index.php index.html index.htm index.nginx-debian.html;
7
8 Server_name IP OR DOMAIN HERE;
9
10 location / {
11 try_files $uri $uri/ =404;
12 }
13 location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Finally we need to make one more change to the config. In order for script to recognize query
strings we need to change one line in first location block to look like this:
1 server {
2 listen 80 default_server;
3 listen [::]:80 default_server ipv6only=on;
4
5 root /var/www/laravel/public;
6 index index.php index.html index.htm;
7
8 server_name IP OR DOMAIN HERE;
9
1 location / {
0 try_files $uri $uri/ /index.php?$query_string;
1
}
1
1
# more location blocks continue below
2
# (no changes needed beyond this point)
1
3
1
4
1
5
1
6
Database Setup
So we installed MySQL a while back, but we haven’t set up an actual database inside of it yet to
store our application data. So now is the time to go set that up, so that we can configure it and
run our migrations.
1 mysql -u root -p
1 exit
App settings are stored inside .env file in app root directory. In order to edit it , cd to app
directory and run:
1 nano .env
Most settings are named as to what they represent so it’s pretty self explanatory.
Populate settings with DB prefix with MySQL database data, and settings with BITCOIND perfix
with your Bitcoind data.
Now it’s good idea to cache our settings. To do that , run from app root:
If you don’t see any errors you have set up database correctly. If you do, go back to MySQL
setup and check for errors.
Next run:
App configuration is now done. If you wisth to know how to run it on TOR this is the tutorial:
https://enter.thewhiterabbit.space/host-tor-hidden-service-with-nginx/
And If you have problem with installing bitcoind on your server follow this series
https://www.youtube.com/watch?v=cMM-t7azzJE