LINUX.ORG.RU

Не получается войти в админ панель Opensips

 , , , ,


0

1

Добрый вечер,

Выглядит странно но факт, уже несколько часов не могу войти в мною установленную админку opensips(на CentoS 7 + Nginx, php-fpm, percona), пользователь в базе с валидным паролем существует, md5 хеш пароля верный. Самое странное что я не смог найти куда пишутся логи при неудачном входе, но проверив скрипты убедился что соединение с базой устанавливается и запрос удачно выполняется и сессия удачно создается! Но в другом скрипте куда меня должно кидать после удачного логина уже данную сессию ‘забрать’ не получается, при том что сам файл сессии c валидным содержимым на диске создается и существует. в логах nginx и php-fpm абсолютно ничего не меняется при неудачном логине. Я нашел более менее рабочее решение использовать strace:

straсe -p мойphp-fpm -f -q -s 4000 -o dump.log

В результате я убеждаюсьчто запрос действительно доходит до СУБД, исполняется и возвращает ВЕРНЫЙ результат с моим дефолтным паролем, следовательно огромное количество возможных проблем уходят…

cat dump.log  | grep -i select
14216 sendto(6, "V\0\0\0\3SELECT * FROM ocp_admin_privileges WHERE username = 'admin' and password = 'opensips'", 90, MSG_DONTWAIT, NULL, 0) = 90
14216 read(7, "# tzdb timezone descriptions (deprecated version)\n#\n# This file is in the public domain, so clarified as of\n# 2009-05-17 by Arthur David Olson.\n#\n# From Paul Eggert (2018-06-27):\n# This file is intended as a backward-compatibility aid for older programs.\n# New programs should use zone1970.tab.  This file is like zone1970.tab (see\n# zone1970.tab's comments), but with the following additional restrictions:\n#\n# 1.  This file contains only ASCII characters.\n# 2.  The first data column contains exactly one country code.\n#\n# Because of (2), each row stands for an area that is the intersection\n# of a region identified by a country code and of a timezone where civil\n# clocks have agreed since 1970; this is a narrower definition than\n# that of zone1970.tab.\n#\n# This table is intended as an aid for users, to help them select timezones\n# appropriate for their practical needs.  It is not intended to take or\n# endorse any position on legal or territorial claims.\n#\n#country-\n#code\tcoordinates\tTZ\t\t\tcomments\nAD\t+4230+00131\tEurope/Andorra\nAE\t+2518+05518\tAsia/Dubai\nAF\t+3431+06912\tAsia/Kabul\nAG\t+1703-06148\tAmerica/Antigua\nAI\t+1812-06304\tAmerica/Anguilla\nAL\t+4120+01950\tEurope/Tirane\nAM\t+4011+04430\tAsia/Yerevan\nAO\t-0848+01314\tAfrica/Luanda\nAQ\t-7750+16636\tAntarctica/McMurdo\tNew Zealand time - McMurdo, South Pole\nAQ\t-6617+11031\tAntarctica/Casey\tCasey\nAQ\t-6835+07758\tAntarctica/Davis\tDavis\nAQ\t-6640+14001\tAntarctica/DumontDUrville\tDumont-d'Urville\nAQ\t-6736+06253\tAntarctica/Mawson\tMawson\nAQ\t-6448-06406\tAntarctica/Palmer\tPalmer\nAQ\t-6734-06808\tAntarctica/Rothera\tRothera\nAQ\t-690022+0393524\tAntarctica/Syowa\tSyowa\nAQ\t-720041+0023206\tAntarctica/Troll\tTroll\nAQ\t-7824+10654\tAntarctica/Vostok\tVostok\nAR\t-3436-05827\tAmerica/Argentina/Buenos_Aires\tBuenos Aires (BA, CF)\nAR\t-3124-06411\tAmerica/Argentina/Cordoba\tArgentina (most areas: CB, CC, CN, ER, FM, MN, SE, SF)\nAR\t-2447-06525\tAmerica/Argentina/Salta\tSalta (SA, LP, NQ, RN)\nAR\t-2411-06518\tAmerica/Argentina/Jujuy\tJujuy (JY)\nAR\t-2649-06513\tAmerica/Argentina/Tucuman\tTucuman (TM)\nAR\t-2828-06547\tAmerica/Argentina/Catamarca\tCatamarca (CT); Chubut (CH)\nAR\t-2926-06651\tAmerica/Argentina/La_Rioja\tLa Rioja (LR)\nAR\t-3132-06831\tAmerica/Argentina/San_Juan\tSan Juan (SJ)\nAR\t-3253-06849\tAmerica/Argentina/Mendoza\tMendoza (MZ)\nAR\t-3319-06621\tAmerica/Argentina/San_Luis\tSan Luis (SL)\nAR\t-5138-06913\tAmerica/Argentina/Rio_Gallegos\tSanta Cruz (SC)\nAR\t-5448-06818\tAmerica/Argentina/Ushuaia\tTierra del Fuego (TF)\nAS\t-1416-17042\tPacific/Pago_Pago\nAT\t+4813+01620\tEurope/Vienna\nAU\t-3133+15905\tAustralia/Lord_Howe\tLord Howe Island\nAU\t-5430+15857\tAntarctica/Macquarie\tMacquarie Island\nAU\t-4253+14719\tAustralia/Hobart\tTasmania (most areas)\nAU\t-3956+14352\tAustralia/Currie\tTasmania (King Island)\nAU\t-3749+14458\tAustralia/Melbourne\tVictoria\nAU\t-3352+15113\tAustralia/Sydney\tNew South Wales (most areas)\nAU\t-3157+14127\tAustralia/Broken_Hill\tNew South Wales (Yancowinna)\nAU\t-2728+15302\tAustralia/Brisbane\tQueensland (most areas)\nAU\t-2016+14900\tAustralia/Lindeman\tQueensland (Whitsunday Islands)\nAU\t-3455+13835\tAustralia/Adelaide\tSouth Australia\nAU\t-1228+13050\tAustralia/Darwin\tNorthern Territory\nAU\t-3157+11551\tAustralia/Perth\tWestern Australia (most areas)\nAU\t-3143+12852\tAustralia/Eucla\tWestern Australia (Eucla)\nAW\t+1230-06958\tAmerica/Aruba\nAX\t+6006+01957\tEurope/Mariehamn\nAZ\t+4023+04951\tAsia/Baku\nBA\t+4352+01825\tEurope/Sarajevo\nBB\t+1306-05937\tAmerica/Barbados\nBD\t+2343+09025\tAsia/Dhaka\nBE\t+5050+00420\tEurope/Brussels\nBF\t+1222-00131\tAfrica/Ouagadougou\nBG\t+4241+02319\tEurope/Sofia\nBH\t+2623+05035\tAsia/Bahrain\nBI\t-0323+02922\tAfrica/Bujumbura\nBJ\t+0629+00237\tAfrica/Porto-Novo\nBL\t+1753-06251\tAmerica/St_Barthelemy\nBM\t+3217-06446\tAtlantic/Bermuda\nBN\t+0456+11455\tAsia/Brunei\nBO\t-1630-06809\tAmerica/La_Paz\nBQ\t+120903-0681636\tAmerica/Kralendijk\nBR\t-0351-03225\tAmerica/Noronha\tAtlantic islands\nBR\t-0127-04829\tAmerica/Belem\tPara (east); Amapa\nBR\t-0343-03830\tAmerica/Fortaleza\tBrazil (northeast: MA, PI, CE, RN, PB)\nBR\t-0803-03454\tAmerica/Recife\tPernambuco\nBR\t-0712-04812\tAmerica/Araguaina\tTo"..., 4096) = 4096

Ниже мои конфиги так как больше я даже не знаю с чего начать и куда двигатся.

Nginx(nginx.cong)

### Managed by puppet, modifications will be lost
###

user 			 nginx;
worker_processes auto;
error_log  		 /var/log/nginx/error.log warn;
pid        		 /var/run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

worker_rlimit_nofile 30000;

events {
    worker_connections 1024;
    use epoll;
    multi_accept on;
    # debug_connection 127.0.0.1;
    # debug_connection 127.0.0.1;

}

http {
	# log vhost header
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" $host';

    access_log  	/var/log/nginx/access.log  main;

    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;
    etag            off;
    include         /etc/nginx/mime.types;
    default_type    application/octet-stream;
    server_tokens   off;

    # custom settings
    server_names_hash_max_size    16384;
    server_names_hash_bucket_size 94;
    keepalive_timeout             5;
    fastcgi_max_temp_file_size    0;
    # for long cookie headers
    client_header_buffer_size  16k;
    large_client_header_buffers 16 16k;

    # allow connection upgrade (Socket.io)
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

    set_real_ip_from мой ip;
    set_real_ip_from мой ip2;
    real_ip_header    X-Forwarded-For;
    include /etc/nginx/conf.d/gzip.conf;

    # do not include include /etc/nginx/conf.d/*.conf
    # this is just partial conf
    # vhost are now in /etc/nginx/vhost.d
    include /etc/nginx/vhost.d/*.conf;
    #fastcgi_read_timeout 300;
}

Nginx(vhost)

server {
    listen 127.0.0.1:8182;
    root /dev/null;
    location = /status {
        stub_status;
                # Security: Only allow access from the IP below.
                allow 127.0.0.1;
                # Deny anyone else
                deny all;
    }
}

#Opensips
server {
        listen *:80;
        server_name opensips.com;
    root /var/www/domains/opensips-cp/web;
    index index.php index.htm index.html;


    error_page 405 =200 @405;

    location @405 {
       include fastcgi.conf;
    }


     	location / {
       fastcgi_pass unix:/var/run/php72-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
       include fastcgi_params;
       fastcgi_read_timeout 60;
    }
}

Percona(Mysqld.cnf)

# Percona Server template configuration
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Opensips(WebPanel): /var/www/domains/opensips-cp/config/db.inc.php

<?php
/*
 * Copyright (C) 2011 OpenSIPS Project
 *
 * This file is part of opensips-cp, a free Web Control Panel Application for 
 * OpenSIPS SIP server.
 *
 * opensips-cp is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * opensips-cp is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

if (!isset($config)) $config = new stdClass();

 //database driver mysql or pgsql
 $config->db_driver = "mysql";	

 //database host
 $config->db_host = "localhost";
 
 //database port - leave empty for default
 $config->db_port = "";
 
 //database connection user
 $config->db_user = "root";
 
 //database connection password
 $config->db_pass = "МОЙПАССДЛЯБД";
 
 //database name
 $config->db_name = "opensips";

 if (!empty($config->db_port) ) $config->db_host = $config->db_host . ";port=" . $config->db_port;
?>

ОС:

CentOS Linux 7 (Core)

Если требуется дополнительная информация то с радостью и оперативно ее предоставлю.



Последнее исправление: Hex-Value (всего исправлений: 3)

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.