Sunday, May 24, 2009

MWDB : Symfony setup



Just found some easy way to install Symfony, a web PHP framework. The reason i tried this is due to Malware Database by Honeynet Malaysia project. Ubuntu jaunty repository only provide v1.0.19.

gento@localhost:~$sudo pear channel-discover pear.symfony-project.com gento@localhost:~$sudo pear install symfony/symfony-1.1.4

It has done in minutes. easy way rather than make, make install...

Follow the INSTALL instruction by spoonfork, i loaded http://mwdb in firefox.

Error in /opt/lampp/var/www/mwdb/cache/frontend/dev/config/config_routing.yml.php,

"Fatal error: Class 'sfRoute' not found in....."

I straight rename this to config_routing.yml.php1. And a new config_routing.yml.php will be generated without the sfRoute function.


Reload the page, another problem found:

Warning: session_start() [function.session-start]: open(/var/www/mwdb/web/tmp/sess_93c6af070dc8acf754ec25e34d7badaf, O_RDWR) failed: No such file or directory (2) in /usr/share/php/symfony/storage/sfSessionStorage.class.php on line 94

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /usr/share/php/symfony/storage/sfSessionStorage.class.php:94) in /usr/share/php/symfony/storage/sfSessionStorage.class.php on line 94

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/share/php/symfony/storage/sfSessionStorage.class.php:94) in /usr/share/php/symfony/storage/sfSessionStorage.class.php on line 94

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/php/symfony/storage/sfSessionStorage.class.php:94) in /usr/share/php/symfony/response/sfWebResponse.class.php on line 296

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/php/symfony/storage/sfSessionStorage.class.php:94) in /usr/share/php/symfony/response/sfWebResponse.class.php on line 310


Warning: session_write_close() [function.session-write-close]: open(/var/www/mwdb/web/tmp/sess_93c6af070dc8acf754ec25e34d7badaf, O_RDWR) failed: No such file or directory (2) in /usr/share/php/symfony/user/sfUser.class.php on line 269

Warning: session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/mwdb/web/tmp) in /usr/share/php/symfony/user/sfUser.class.php on line 269
line 94

The problem should solve if we set the session.save_path corrently eg session.save_path = "/opt/lampp/var/www/mwdb/web/tmp/" in /etc/php.ini of LAMPP. Yet it wont solve after thousand try out! I suspect it is due to incompatibility or bug with LAMPP v1.7.1 and Symfony v1.4.1.

I decided to unable the session function by comment out session_start() and session_write_close().

In /usr/share/php/symfony/storage/sfSessionStorage.class.php ( Line 94)


if ($this->options['auto_start'] && !self::$sessionStarted)
{
// session_start(); // modify by gento
self::$sessionStarted = true;
}

In /usr/share/php/symfony/user/sfUser.class.php (Line 269)

// write culture to the storage
$this->storage->write(self::CULTURE_NAMESPACE, $this->culture);

//session_write_close(); // modify by gento
}


It works! Now i have exact same mwdb layout as in http://mwdb.my-honeynet.org/.

Current mwdb in my-honeynet.org only work well with Symfony v 1.1.4, i tried on v1.0.19 and latest v1.2.7, both have errors.

Next : automated submission script for sample data analysis to mwdb

1 comment:

  1. I modified the session_start(); as you stated, in my storage/sfSessionStorage.class.php file, and ran my site... symfony is not happy. Rather than just getting the warnings as you see before, I get a fatel err, so I reverted back the changes, till I can find something better.

    Fatel error: Access to undeclared static property:sfSessionStorage::$sessionStarted in ..../symfony/storage/sfSessionStorage.class.php on line 78

    running v1.0.17

    Thanks for the info though.

    ReplyDelete