view · edit · sidebar · attach · print · history

20130626-setup-ganglion-ch-and-davatz-com

<< | Index | >>


Summary

  • Setup ganglion.ch && debug PHP errors
  • Setup davaz.com && debug Server configuration

Commits / Patches

ganglion.ch

Index / Status


Setup ganglion.ch

set up ganglion.ch in local VM.

% php -v
PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar  4 2013 13:11:17) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

ganglion.ch uses:

  • mysql
  • php

restored mysql database from backup SQL.

% mysql -u USER --database DBNAME -p < ./bak.mysql.2013-06-10_21.24.36_ganglion.* 
+--------------------+
| Tables_in_ganglion |
+--------------------+
| artikel            |
| forum_inhalt       |
| forum_thread       |
| kurse              |
| kurse_profil       |
| links              |
| newsletter         |
| profil             |
| spy                |
| text               |
| thema              |
| vortrag            |
+--------------------+

PHP and Ruby conflict

IF enabled mod_php5 in apache2, then apache2 does not respond againt any request...

CONFLICT

  • mod_ruby 1.8.6
  • libphp5.so (5.3)

I enable/disable LoadModule in /etc/apache2/modules.d/{ruby|php}.load.
I could not enable both in same time :'(

Note

ganglion.ch has DB-Connection in several files.

% grep -r \$user\  doc
doc/html/php/mysql_header.php:$user = "xxxxx";
doc/wsadmin/php/property.php:$user = "xxxxx";

Debug error on production

neuer Eintrag

In my local, this works fine.

:

But got errors on production.
Debug this errors.

Notice: Undefined offset: 1 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 60
Notice: Undefined offset: 2 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 61
Notice: Undefined offset: 3 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 62
Notice: Undefined offset: 4 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 63
Notice: Undefined offset: 5 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 64
Notice: Undefined offset: 6 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 65
Notice: Undefined offset: 7 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 66
Notice: Undefined offset: 8 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 67
Notice: Undefined offset: 9 in /var/www/ganglion.ch/doc/wsadmin/php/printVortraege.php on line 68
patch

Debug edit/new form view

admin.php does not return edit/new form view.

admin.php
...
<?php
if (empty($page)) {   $page = "vortrag";  }
if (empty($new))  { $new = "false";   }   
if (empty($change)) { $change = "false";  }

print $change; #=> production is false, my local machine returs true

PHP cannot handle this global variable.
PHP in ganglion.ch uses many global variables.

This is not good. (But alread too many variables are there.)

http.conf
  <IfModule mod_php5.c>
    php_admin_flag register_globals on          #=> this means this application does not work in PHP 5.4
    php_admin_value post_max_size 100M
    php_admin_value upload_max_filesize 100M
  </IfModule>
  • In PHP 5.3, register globals is deprecated.
  • In PHP 5.4, register globals is gone.

Fastpower has PHP5.4.
But maybe this application wored php3 or php4.

$ sudo emerge -av php
...
...
[ebuild   R    ] dev-lang/php-5.4.13-r2:5.4  USE="apache2 berkdb bzip2 cjk cli crypt ctype curl fileinfo filter ftp gd gdbm gmp hash iconv intl ipv6 json mhash mysql nls phar posix postgres readline session simplexml ssl tokenizer unicode xml zlib -bcmath -calendar -cdb -cgi -curlwrappers -debug -doc -embed -enchant -exif -firebird -flatfile -fpm (-frontbase) -imap -inifile -iodbc -kerberos -ldap -ldap-sasl -libedit -mssql -mysqli -mysqlnd -oci8-instant-client -odbc -pcntl -pdo -qdbm -recode (-selinux) -sharedmem -snmp -soap -sockets -spell -sqlite (-sybase-ct) -sysvipc -threads -tidy -truetype -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -zip" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] 
yasaka@fastpower /var/www/ganglion.ch $ equery l -po php
 * Searching for php ...
[-P-] [  ] dev-lang/php-5.3.18:5.3
[-P-] [  ] dev-lang/php-5.3.20:5.3
[-P-] [  ] dev-lang/php-5.3.21-r1:5.3
[-P-] [  ] dev-lang/php-5.3.23:5.3     #=> installed
[-P-] [  ] dev-lang/php-5.3.23-r1:5.3
[-P-] [  ] dev-lang/php-5.4.8:5.4
[-P-] [  ] dev-lang/php-5.4.13:5.4
[IP-] [  ] dev-lang/php-5.4.13-r2:5.4

Then, I installed php5.3

% sudo emerge -C php
% sudo USE="apache2 fpm" emerge -av =app-admin/eselect-php-0.6.2 =dev-lang/php-5.3.23

link

#undefined variables-problem Undefined variables Problem

There are many Undefained variable Notice.
In PHP5, should use isset() for check variable.

[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: msgConf_pdf in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 50, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: msgConf_audiofile in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 51, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: Zielpublikum in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 149, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: location in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 193, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: Titel in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 200, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: Zusammenfassung in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 207, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: audiofile_name in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 235, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php
[Wed Jun 26 15:11:13 2013] [error] [client 10.0.1.10] PHP Notice:  Undefined variable: audiofile_size in /home/yasuhiro/.work/usr/ywesee/src/ganglion.ch/doc/wsadmin/php/vortrag.php on line 242, referer: http://ganglion.yasuhiro.ch/wsadmin/php/admin.php

To prevent this output,

in httpd.conf

 <IfModule mod_php5.c>
    php_value error_reporting 0    #=> added for production.
    # php <= 5.3
    php_admin_flag register_globals on
    php_admin_value post_max_size 100M
    php_admin_value upload_max_filesize 100M
  </IfModule>

NOTE

in php.ini

;error_reporting = E_ALL | E_STRICT
error_reporting = E_ALL & ~E_DEPRECATED

Links

All function work without error.


Setup davaz.com

  • davaz.com

Debug DRb Connection error

[Wed Jun 26 10:21:21 2013] [error] access to /en/gallery/ajax_movie_gallery/artobject_id/662 failed for (null), reason: Wed Jun 26 10:21:21 +0200 2013 - 69840597189500 - DRb::DRbConnError - druby://localhost:9998 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
[Wed Jun 26 10:21:21 2013] [error] access to /en/gallery/ajax_movie_gallery/artobject_id/662 failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:736:in `open'
[Wed Jun 26 10:21:21 2013] [error] access to /en/gallery/ajax_movie_gallery/artobject_id/662 failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:729:in `each'
...
[Wed Jun 26 10:22:05 2013] [error] access to /en/personal/home failed for (null), reason: Wed Jun 26 10:22:05 +0200 2013 - 69840597197640 - DRb::DRbConnError - druby://localhost:9998 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
[Wed Jun 26 10:22:05 2013] [error] access to /en/personal/home failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:736:in `open'
[Wed Jun 26 10:22:05 2013] [error] access to /en/personal/home failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:729:in `each'
[Wed Jun 26 10:22:05 2013] [error] access to /en/personal/home failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:729:in `open'
...

Then I starded druby application process.

Error in sbsm session

This means cannot connect yus, correctly.

[Wed Jun 26 10:25:41 2013] [error] access to /en/personal/home failed for (null), reason: (druby://localhost:9998) /var/www/new.davaz.com/src/util/session.rb:42:in `logout'
[Wed Jun 26 10:25:41 2013] [error] access to /en/personal/home failed for (null), reason: (druby://localhost:9998) /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/session.rb:100:in `initialize'
[Wed Jun 26 10:25:41 2013] [error] access to /en/personal/home failed for (null), reason: (druby://localhost:9998) /var/www/new.davaz.com/src/util/session.rb:18:in `initialize'
...

Setup yusd for davaz.com

yus of gem version uses still yet pg.
I updated yusd

yasaka@fastpower /etc/yus % ./svc/run 
/usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/yus-1.0.0/lib/yus/server.rb:9: warning: already initialized constant VERSION
/usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:300:in `load_driver': Unable to load driver 'pg' (underlying error: wrong constant name pg) (DBI::InterfaceError)
        from /usr/local/bin/ruby186/lib/ruby/1.8/monitor.rb:242:in `synchronize'
        from /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:242:in `load_driver'
        from /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:160:in `_get_full_driver'
...
% sudo -u postgres createdb -E UTF8 -T template0 yus
% sudo -u postgres createuser yus #=> (what was PASSWORD for yus on Whitie ?)
% sudo zcat 21\:00-postgresql_database-yus-backup.gz | psql -U postgres yus

setuped daemontool for davaz.com-yus service.

yasaka@fastpower /etc/yus $ ./svc/run 
/usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/yus-1.0.1/lib/yus/server.rb:9: warning: already initialized constant VERSION
ERROR:  relation "object" already exists

ERROR:  relation "extent_index" already exists

ERROR:  relation "object_connection" already exists

ERROR:  relation "target_id_index" already exists

ERROR:  relation "collection" already exists

I, [2013-06-26T10:59:57.145098 #15862]  INFO -- start: starting yus-server on drbssl://localhost:9997
I, [2013-06-26T11:00:17.402583 #15862]  INFO -- Yus::Server: Logout for 
I, [2013-06-26T11:00:37.761641 #15862]  INFO -- Yus::Server: Logout for 
...
...

I could get many beautiful Pictures ;)

Question

What was PASSWORD for yus on Whitie ?

TODO

  • robots.txt
  • Debug javascript Errors.
robots.txt
[Wed Jun 26 11:07:25 2013] [error] [client 198.27.82.155] File does not exist: /var/www/new.davaz.com/doc/robots.txt
error on javascript
ReferenceError: require is not defined
  http://davaz.com/en/works/multiples/
  Line 11
view · edit · sidebar · attach · print · history
Page last modified on June 26, 2013, at 11:14 AM