服务器地址修改

doctree
zcy 2023-07-29 09:37:53 +08:00
parent dc5772d6f6
commit 849c5b40d2
5 changed files with 8 additions and 11 deletions

View File

@ -12,7 +12,7 @@ class Config
* Database host
* @var string
*/
const DB_HOST = '117.50.176.114';
const DB_HOST = '117.50.187.222';
/**
* Database name
* @var string
@ -29,7 +29,7 @@ class Config
* Database password
* @var string
*/
const DB_PASSWORD = '12345678';
const DB_PASSWORD = 'zhengcaiyu123';
/**
* Show or hide error messages on screen
* @var boolean

View File

@ -57,7 +57,7 @@ abstract class Model
if ($db === null) {
$dsn = "";
if($_SERVER['HTTP_HOST'] == '127.0.0.1')
$dsn = 'mysql:host=117.50.176.114' . ';dbname=' . Config::DB_NAME . ';charset=utf8';
$dsn = 'mysql:host=117.50.187.222' . ';dbname=' . Config::DB_NAME . ';charset=utf8';
else
$dsn = 'mysql:host=127.0.0.1' . ';dbname=' . Config::DB_NAME . ';charset=utf8';
try {

View File

@ -1,6 +1,6 @@
{
"require": {
"twig/twig": "~2.0",
"twig/twig": "~3.0",
"propel/propel": "~2.0@dev",
"erusev/parsedown": "^1.7",
"benjaminhoegh/parsedown-toc": "^1.4"
@ -23,6 +23,6 @@
]
},
"require-dev": {
"contributte/nextras-orm-generator": "^0.2.0"
}
}

View File

@ -1,8 +1,7 @@
rm ../code.tar.gz
del ../code.tar.gz
tar.exe -czf ../code.tar.gz ./*
scp -i ./id_rsa ../code.tar.gz ubuntu@117.50.176.114:/home/ubuntu/
ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo tar -zxvf /home/ubuntu/code.tar.gz -C /var/www/html/api/
ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo rm /home/ubuntu/code.tar.gz
scp -i ./id_rsa_s ../code.tar.gz ubuntu@117.50.187.222:/home/ubuntu/
ssh -t -i ./id_rsa_s ubuntu@117.50.187.222 sudo tar -zxvf /home/ubuntu/code.tar.gz -C /var/www/html/api/
ssh -t -i ./id_rsa_s ubuntu@117.50.187.222 sudo rm /home/ubuntu/code.tar.gz

View File

@ -49,7 +49,6 @@ if($_SERVER['HTTP_HOST'] == '117.50.176.114'){
}
try{
//for prefight request
if($_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
@ -60,7 +59,6 @@ try{
//print "";
return;
}else{
//print_r($_SERVER['REQUEST_URI'],\App\Config::ROUTE_PREFIX_DEV);
$router->dispatch($_SERVER['REQUEST_URI']);
}
}catch (Exception $exception){