Apache errors - vlogger keeps failing

Discussion in 'Installation/Configuration' started by jumba, May 11, 2012.

  1. till

    till Super Moderator Staff Member ISPConfig Developer

    Please try to use the vlogger version from Ubuntu to see if you get the same problems there:

    apt-get install vlogger

    then edit the file:

    /etc/apache2/sites-available/ispconfig.conf

    and replace the line:

    Code:
    CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" -d \"/etc/vlogger-dbi.conf\" /var/log/ispconfig/httpd" combined_ispconfig
    with:

    Code:
    CustomLog "| /usr/sbin/vlogger -s access.log -t \"%Y%m%d-access.log\" -d \"/etc/vlogger-dbi.conf\" /var/log/ispconfig/httpd" combined_ispconfig
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    And check if the dependencies are installed:

    apt-get install libdbi-perl libtimedate-perl
     
  3. jumba

    jumba Member

    Vlogger from Ubuntu and all its dependencies were already installed during the perfect server setup.

    I replaced the old line with the new one in ispconfig.conf and now I get:
    Code:
    DBI connect('database=dbispconfig;host=localhost:3306','ispconfig',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/sbin/vlogger line 507
    
    Code:
    DBI Error:  at /usr/sbin/vlogger line 507, <STDIN> line 60.
    Code:
    piped log program ' /usr/sbin/vlogger -s access.log -t "%Y%m%d-access.log" -d "/etc/vlogger-dbi.conf" /var/log/ispconfig/httpd' failed unexpectedly
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check the file /etc/vlogger-dbi.conf and compare the database name, username and password in that file if they are identical with the ones in the file /usr/local/ispconfig/interface/lib/config.inc.php
     
  5. jumba

    jumba Member

    Yes, the database name, username and password are identical.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    There seems to be a general problem that perl cant connect to a mysql server. Try to change the:

    host=localhost

    to

    host=127.0.0.1

    in the /etc/vlogger-dbi.conf file and restart apache.
     
  7. jumba

    jumba Member

    Ok, I did that.
    Now, with Vlogger from Ubuntu I get this:
    Code:
    piped log program ' /usr/sbin/vlogger -s access.log -t "%Y%m%d-access.log" -d "/etc/vlogger-dbi.conf" /var/log/ispconfig/httpd' failed unexpectedly
    
    Code:
    DBD::mysql::db do failed: Table 'dbispconfig.wwwusage' doesn't exist at /usr/sbin/vlogger line 521, <STDIN> line 104.
    DBD::mysql::st execute failed: Table 'dbispconfig.wwwusage' doesn't exist at /usr/sbin/vlogger line 514, <STDIN> line 104.
     
  8. jumba

    jumba Member

    and if I change back to the original Vlogger in ispconfig.conf, I get the old error
    Code:
    piped log program ' /usr/local/ispconfig/server/scripts/vlogger -s access.log -t "%Y%m%d-access.log" -d "/etc/vlogger-dbi.conf" /var/log/ispconfig/httpd' failed unexpectedly
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, this is most likely caused due to the usage of the vlogger script from ubuntu as ispconfig uses a different table name. Please undo the change of the customlog directive in the ispconfig.conf file that we did in this step:

    http://www.howtoforge.com/forums/showpost.php?p=279265&postcount=21

    so that the vlogger script from ispconfig is used again, but keep the edited /etc/vlogger-dbi.conf file and check if the problem is solved now.

    to sum it up, perl can not connect to mysql on hostname localhost but it can connect to the IP of localhost, now we just have to try to find out what the problem in the mysql or hostname configuration is.

    Please post the /etc/hosts file of your server and the output of:

    netstat -tap
     
  10. oriongr

    oriongr Member

    Hi,
    I am not sure I have the same error...but for sure vlogger is the cause of the problem.
    If I try to run vlogger manually this is what I get
    For now I have disabled vlogger..
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not run vlogger manually,so the errors are ok. The problem is caused by a missing perl package which is not a dependency of the ubuntu vlogger package and which was not nescessary in Ubuntu versions < 12.04. The package that has to be installed is:

    libclass-dbi-mysql-perl

    install it with:

    apt-get install libclass-dbi-mysql-perl
     
  12. Raziel

    Raziel New Member

    OS: Ubuntu-Server Rel. 12.04 LTS (fresh install)

    Code:
    libclass-dbi-mysql-perl is already the newest version.
    And still:

    Code:
    piped log program ' /usr/local/ispconfig/server/scripts/vlogger -s access.log -t "%Y%m%d-access.log" -d "/etc/vlogger-dbi.conf" /var/log/ispconfig/httpd' failed unexpectedly
    Anything else ? :)
     
    Last edited: May 27, 2012
  13. till

    till Super Moderator Staff Member ISPConfig Developer

  14. Raziel

    Raziel New Member

    Still no luck for me (failed unexpectedly).
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    I have reporst from severalusers that the change in my.cnf fixed the issue.Please check again that you added it to the corrrect config section and that you restarted mysql and apache afterwards.
     
  16. Raziel

    Raziel New Member

    vlogger-dbi.conf
    Code:
    dsn DBI:mysql:database=dbispconfig;host=127.0.0.1:3306
    user ispconfig
    pass ************ (identical to the one in ispconfig/interface/lib/config.inc.php
    dump 30
    apache2.conf
    Code:
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
    #
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    
    sites-enabled/000-ispconfig.conf
    Code:
    LogFormat "%v %h %l %u %t \"%r\" %>s %B \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" -d \"/etc/vlogger-dbi.conf\" /var/log/ispconfig/httpd" combined_ispconfig
    /etc/mysql/my.cnf
    Code:
    [mysqld]
    ...
    max_connections        = 500
    max_user_connections   = 500
    ...
    I appreciate if you could give me a hand on this. I'm not a beginner but I ran out of ideas for the moment... If you need other informations, please ask. Thank you in advance.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    I have no idea why it does not work on your server. The problem is that perl ( vlogger) cant connect reliably to mysql. As a workaround you can disable traffic logging by editing the file:

    sites-enabled/000-ispconfig.conf

    and changing the line:

    Code:
    CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" -d \"/etc/vlogger-dbi.conf\" /var/log/ispconfig/httpd" combined_ispconfig
    to

    Code:
    CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
    and restart apache. This disables only traffic logging, webalizer and awstats will work.
     
  18. tricofcu

    tricofcu New Member

    Apache error

    Hello, I have been redirected to this thread as my thread was closed and specified i should look here.

    My thread http://www.howtoforge.com/forums/showthread.php?p=279776#post279776


    I made the changed to my.cnf according the above thread:

    ***************
    Edit mysql my.cnf file and add the lines

    max_connections = 500
    max_user_connections = 500

    In the [mysqld] section and restart mysql.
    ***************


    but when i do i get the following error

    DBI connect('database=dbispconfig;host=127.0.0.1:3306','ispconfig',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /usr/local/ispconfig/server/scripts/vlogger line 514
    DBI Error: at /usr/local/ispconfig/server/scripts/vlogger line 514, <STDIN> line 307.
    [Tue May 29 09:20:03 2012] [error] [client 10.43.144.190] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 76, referer: https://192.168.251.25:8080/index.php

    i had to remove the changes i made and rebooted the server and was able to get my server running again.

    but i am still getting

    piped log program ' /usr/local/ispconfig/server/scripts/vlogger -s access.log -t "%Y%m%d-access.log" -d "/etc/vlogger-dbi.conf" /var/log/ispconfig/httpd' failed unexpectedly

    I saw the previous post said to disable vlogger but is this really recommended?
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    The previous post does not disable vlogger, it disables traffic logging to mysql in vlogger so vlogger is still active and used to split logfiles, it is not disabled. This is the only option at the moment until we found out why perl is not able to connect to mysql 5.5 reliably on Ubuntu 12.10 while the same code works on Debian 6 and Ubuntu 11.10.

    Thats a different issue, this problem is either caused by a rong setting in mysql my.cnf (e.g. a typo when you edited it or by inserting the two lines in a wrong section) or the mysql login details in the /etc/vlogger-dbi.conf file are wrong.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats decsribed already above in this thread, see #37.

    The priority in the bugtracker is correct, only security bugs get a priority that is higher. Beside that, only some servers are affected by this issue, have ag test sytm here were I set the max connections value to 500 as I suggested and I'am not able to trigger this anymore by running > 1 million requests on the server with test script.
     

Share This Page