Step 6: Setting up the database

Post Reply
techbreak
Posts: 2
Joined: Wed May 02, 2018 2:06 pm

Step 6: Setting up the database

Post by techbreak »

in the Frontend Directory, for editing the 'cfg.php' file what have mentioned in the guide is differ from the original file.

Actual code in the source file (bitexchange_cash.zip)
<?php
class object {}
$CFG = new object();
if ($_SERVER['SERVER_NAME'] == 'localhost') {
$base_url = "http://localhost/bit_live/";
$CFG->api_url = $base_url.'api/htdocs/api.php';
$CFG->auth_login_url = $base_url.'auth/htdocs/login.php';
$CFG->auth_verify_token_url = $base_url.'auth/htdocs/verify_token.php';
} else {
$base_url = "http://167.99.199.150/bit_live/";
$CFG->api_url = 'https://api.bitexchange.cash/api.php';
$CFG->auth_login_url = 'https://auth.bitexchange.cash/login.php';
$CFG->auth_verify_token_url = 'https://auth.bitexchange.cash/verify_token.php';
}
?>

___________

I changed the code as like below,

<?php
class object {}
$CFG = new object();
if ($_SERVER['SERVER_NAME'] == 'localhost') {
$base_url = "http://mybitexchange.com/";
$CFG->api_url = $base_url.'api/htdocs/api.php';
$CFG->auth_login_url = $base_url.'auth/htdocs/login.php';
$CFG->auth_verify_token_url = $base_url.'auth/htdocs/verify_token.php';
} else {
$base_url = "http://mybitexchange.com/";
$CFG->api_url = 'https://api.mybitexchange.com/api.php';
$CFG->auth_login_url = 'https://auth.mybitexchange.com/login.php';
$CFG->auth_verify_token_url = 'https://auth.mybitexchange.com/verify_token.php';
}
?>


_______________

AND my query is,
should i provide the url as IP address (159.65.145.103) or website name (mybitexchange.com) or any other changes need to be implement please update me...

As additional information a image file is included which is about droplet dashboard. And i am unable to attach 'error.log' file from the server '/var/log/apache2'.

so few lines are taken from that file as below,

[Wed May 02 10:15:24.257130 2018] [:error] [pid 13905] [client 122.178.169.64:50550] PHP Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone () in /var/www/html/frontend/lib/common.php:93\nStack trace:\n#0 /var/www/html/frontend/lib/common.php(93): DateTimeZone->__construct('')\n#1 /var/www/html/frontend/htdocs/index.php(3): include('/var/www/html/f...')\n#2 {main}\n thrown in /var/www/html/frontend/lib/common.php on line 93
Attachments
DigitalOcean.png
DigitalOcean.png (172.94 KiB) Viewed 19646 times
balaji
Posts: 18
Joined: Thu Apr 26, 2018 2:34 pm

Re: Step 6: Setting up the database

Post by balaji »

Hello,

If your domain is pointed to your exchange main server IP address, then you can mention the domain name for the URLs.

From the code which you have sent, i can see in base_url you have the url without ssl - http. But in api,auth,auth_verify_token_url you have the url with SSL - https. Make sure you have SSL installed for your domain. If not remove http's'.

After this If you still see "PHP Fatal error: Uncaught Exception" in the error log, kindly reply back with the error and your changes. I'll help you out.
techbreak
Posts: 2
Joined: Wed May 02, 2018 2:06 pm

Re: Step 6: Setting up the database

Post by techbreak »

Hai,

Thanks for your valuable instruction, now the setup is done upto Step:7 and site is working good.

My query relates to the topic 'How to install Zcash in your server', in this main Step:6 sub-step: 11 command 'zcash-fetch-params' is showing error message as 'command not found'. While go through all the steps, main Step:5 is differ from 'How to install Bitcoin Cash in your server'.

Same problem with 'How to install Litecoin in your server'', in this main Step:6 sub-step: 11 command 'sudo chmod 0600 litecoin.conf' is showing error message as 'No such file or directory'.

My another query relates to the frontend where the register and login page showing error as '404 not found'. My home page URL is 'http://domain.com/' and the registration page is redirecting to 'http://domain.com/register' while i edit the URL as 'http://domain.com/register.php' its working. Also for registration i received registration success mail with username and password, BUT login page is not working.

Thanks in advance
balaji
Posts: 18
Joined: Thu Apr 26, 2018 2:34 pm

Re: Step 6: Setting up the database

Post by balaji »

hi
kindly include ' sudo' in front of 'zcash-fetch-params' after this step run zcash daemon, then the zcash server will get start.
Post Reply

Return to “Techbreak Installation”