Insert in DB issues, phpmyadmin (SSL) issues, no acces issues

Discussion in 'Server Operation' started by jjsjjs, May 31, 2019.

  1. jjsjjs

    jjsjjs New Member

    Hi,

    i'm running into a few issues which i'm not able to solve(too less knowledge i suppose) so i need some help please.
    I followed this tut https://www.howtoforge.com/tutorial...pureftpd-bind-postfix-doveot-and-ispconfig/2/ and it runs.
    It is only used as a database server, so there is not a website running on it.
    With all below cases i can connect via FTP (winscp) or Putty.

    1. phpmyadmin gives an error about blowfish. I checked the config file and in this file a line points to /var/lib/phpmyadmin/blowfish_secret.inc.php which has the secret phrase in it.
    So i don't understand why phpmyadmin points me to the error.

    2. after been logged in then sometimes i get kicked out of phpmyadmin(probably due to long inactive) but even if i log out, i can't log-in again. Connection refused. mysqli_real_connect(): (HY000/2002): Connection refused
    But then i can also not login into ispconfig. (allthough insert entries via php is still working so MYSQL seems to run) i need to reboot via putty shell. Could this be related to https/http and cookie setting?

    3. i have ssl installed according the tutorial, and also did request a key via ispconfig(when i could login) because it seems phpmyadmin is still http instead of https. ISPconfig is https.
    If i put https in front of the URL i get the error SSL_ERROR_RX_RECORD_TOO_LONG How can i solve this, so phpmyadmin is also https?

    4. i'm trying to fill a bunch of database tables with data via php. each table has between 4000 and 14000 entries. especially the bigger ones give trouble. For the first say 5000 it runs fast and smooth and then it starts to slow down to like 1 or to entries inserted every few seconds.
    Anybody have a clue why it first fast and later on slow. Nothing further yet is happening with the db. It seems it can not cope with a lot of insert after each other.

    in error.log i have 2 errors which are there on numerous lines:
    [Sun May 26 12:33:47.436624 2019] [proxy_fcgi:error] [pid 79645] [client ***ip***:port] AH01071: Got error 'PHP message: PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /var/www/clients/client0/web1/web/somewebsite/afile.php on line 9\n'

    /clients/client0/web1/web/somewebsite/afile.php on line 8\nPHP message: PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /var/www/clients/client0/web1/web/somewebsite/temp_add6ppdata.php:8\nStack trace:\n#0 {main}\n thrown in /var/www/clients/client0/web1/web/somewebsite/afile.php on line 8\n'

    Strange the php file used was checked on phpcodechecker and gave no errors, but i guess i needed to make a global variable

    2019-05-27 18:35:21 139800739163264 [ERROR] mysqld: Out of memory (Needed 128663552 bytes)
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: Using mutexes to ref count buffer pool pages
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: The InnoDB memory heap is disabled
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: Compressed tables use zlib 1.2.11
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: Using Linux native AIO
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: Using generic crc32 instructions
    2019-05-27 18:35:21 139800739163264 [Note] InnoDB: Initializing buffer pool, size = 128.0M
    InnoDB: mmap(140574720 bytes) failed; errno 12
    2019-05-27 18:35:21 139800739163264 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
    2019-05-27 18:35:21 139800739163264 [ERROR] Plugin 'InnoDB' init function returned error.
    2019-05-27 18:35:21 139800739163264 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    2019-05-27 18:35:21 139800739163264 [Note] Plugin 'FEEDBACK' is disabled.
    2019-05-27 18:35:21 139800739163264 [ERROR] Unknown/unsupported storage engine: InnoDB
    2019-05-27 18:35:21 139800739163264 [ERROR] Aborting

    How can i solve the memory issue?
    How can InnoDB not be supported (it seems to work when i look in phpmyadmin.

    It's a small server i'm working on to try things out, 1GB of memory, 50GB storage, 1 processor 1.2GHz. Bandwidth i saw 7.54TB
    The data i'm trying to fill will be in total 1GB.

    Thanks for any help on this.

    Regards,
    Jerry
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What is that error text?
    How much RAM does that host have? How much swap?
    Monitor RAM and swap usage, make bigger swap.
    You seem to have lots of strange errors. If this is newly installed system and I assume you are not running it in production yet due to lots of errors, I suggest installing the system from scratch and pay close attention that you really follow the installation guide carefully.
     
  3. jjsjjs

    jjsjjs New Member

    Hi,
    it's in Dutch
    Het configuratiebestand heeft nu een geheime wachtwoordzin nodig (blowfish_secret).
    Means: The configuration file need a secret phrase.
    De $cfg['TempDir'] (./tmp/) is niet benaderbaar. phpMyAdmin kan de templates niet in de cache zetten en zal daardoor langzamer werken.
    Means : that the .tmp folder is not reachable and phpmyadmin can't put templates in cache, and will work slower.

    I can't start from scratch it's already running and has already lots of data in it.
    The RAM available to me is 1 GB, i don't know how bid the swap is. How do i check it?

    Thanks!
     
  4. jjsjjs

    jjsjjs New Member

    Ok found a tutorial to check and add a swap, that succeeded. SO the swap file now in use is 1GB.
    linux swap created.PNG
    linux mem after swap creation.PNG

    If you have any hints on the other problems then please add them. I will try to find a solution too.
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    With 1 G RAM and 1 G Swap, you have 2 G memory space available. I would have created a 4 GB swap to keep "Out of memory" away. But like I wrote, monitor your free memory and Swap usage, if they do not get full your system runs adequately.
     
    jjsjjs likes this.
  6. jjsjjs

    jjsjjs New Member

    Thanks Taleman, i will check if i can increase the swap and see from there.
     
  7. jjsjjs

    jjsjjs New Member

    Hi,
    I increased the swap to 4GB. I will post a screen shot later of the used memory.
    I found a log file with many lines of an Chinese IP address posting everytime a strange somename.php file towards my server. Also wit WP (wordpress) in it, i don't have a cms running.
    If i did check correctly, the IP was not blocked by fail2ban. If i have time tonight i can post a piece of the log. How to enter that IP manually to FAIL2BAN?
    Strange thing is that php scripts that i use as middleware to post and get things from the DB do not work anymore, from one day to the next. With a message that some line is not correct. I checked a test php file on several online phpcode checkers and found no error. It worked before but, all of a sudden not anymore.
    I get a message back that the $_POST is empty. I checkd many sites on this problem like stackoverflow and others and they talking mainly about JSON arrays, which i don't use for this. What i use is simple id=1&name=elvis&surname=presly etcetera.

    Thanks.
     
  8. jjsjjs

    jjsjjs New Member

    Hi Here are a few of the dozens of lines with the same IP from the access log, looking up the ip it's not a robot i think.
    02.9.39.96 - - [02/Jun/2019:19:42:31 +0000] "GET /izom.php HTTP/1.1" 301 586 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:31 +0000] "GET /composer.php HTTP/1.1" 301 594 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:31 +0000] "GET /hue2.php HTTP/1.1" 301 586 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:32 +0000] "GET /Drupal.php HTTP/1.1" 301 590 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:32 +0000] "GET /lang.php?f=1 HTTP/1.1" 301 594 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:32 +0000] "GET /izom.php HTTP/1.1" 301 586 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:32 +0000] "GET /payload.php HTTP/1.1" 301 592 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:32 +0000] "GET /new_license.php HTTP/1.1" 301 600 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:33 +0000] "GET /images/!.php HTTP/1.1" 301 594 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:33 +0000] "GET /images/vuln.php HTTP/1.1" 301 600 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:33 +0000] "GET /hd.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:33 +0000] "GET /images/up.php HTTP/1.1" 301 596 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:33 +0000] "GET /images/attari.php HTTP/1.1" 301 604 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:34 +0000] "GET /images/jsspwneed.php HTTP/1.1" 301 610 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:34 +0000] "GET /images/stories/cmd.php HTTP/1.1" 301 614 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    54.36.149.42 - - [02/Jun/2019:19:42:34 +0000] "GET /manual/en/howto/public_html.html HTTP/1.1" 301 618 "-" "Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)"
    202.9.39.96 - - [02/Jun/2019:19:42:34 +0000] "GET /images/stories/filemga.php?ssp=RfVbHu HTTP/1.1" 301 644 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:34 +0000] "GET /up.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:34 +0000] "GET /huoshan.php HTTP/1.1" 301 592 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:35 +0000] "GET /laravel.php HTTP/1.1" 301 592 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:35 +0000] "GET /yu.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:35 +0000] "GET //wp-content/plugins/si-captcha-for-wordpress/captcha/ttffonts/theme.php?up=1 HTTP/1.1" 301 720 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
    202.9.39.96 - - [02/Jun/2019:19:42:35 +0000] "POST /wuwu11.php HTTP/1.1" 301 590 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:36 +0000] "POST /xw.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:36 +0000] "POST /xw1.php HTTP/1.1" 301 584 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:36 +0000] "POST /9678.php HTTP/1.1" 301 586 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:36 +0000] "POST /wc.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:36 +0000] "POST /xx.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:37 +0000] "POST /xx.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:37 +0000] "POST /s.php HTTP/1.1" 301 580 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:37 +0000] "POST /w.php HTTP/1.1" 301 580 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:37 +0000] "POST /sheep.php HTTP/1.1" 301 588 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:37 +0000] "POST /qaq.php HTTP/1.1" 301 584 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:38 +0000] "POST /my.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:38 +0000] "POST /qq.php HTTP/1.1" 301 582 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:38 +0000] "POST /aaa.php HTTP/1.1" 301 584 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:38 +0000] "POST /hhh.php HTTP/1.1" 301 584 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:38 +0000] "POST /jjj.php HTTP/1.1" 301 584 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"
    202.9.39.96 - - [02/Jun/2019:19:42:39 +0000] "POST /vvv.php HTTP/1.1" 301 584 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Firefox/31.0"

    Pic of the mem usage:
    linux mem usage.PNG
    swap usage:
    linux swap usage.PNG
    Looks ok.
    Now i have to figure out why $_POST is empty all of a sudden.
     
  9. jjsjjs

    jjsjjs New Member

    boy oh boy, i found the culprit of the $_POST not wanting to work, although it worked before. I forgot that i changed th redirect after i've read some about it. I've putten it on R=301,L and domain.tld=>www.domain.tld.
    Now after reading a lot of issues, many people had issue with redirecting so i thought let's check. I've set it back to no redirect, as it's not neccessary in my case. $_POST is working ok again.
    linux redirect.PNG
     
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Read
    Code:
    man fail2ban-client
    about addignoreip.
    But it gets added automatically if suspicious activity comes from that IP.
     
    jjsjjs likes this.
  11. jjsjjs

    jjsjjs New Member

    Thanks!
     

Share This Page