Metasploit mailing list archives

postgresql database problems


From: tothakosh at gmail.com (Akos Toth)
Date: Thu, 7 May 2009 19:08:00 +0200

Hi Simen,

A while ago I also had some issues getting autopwn to work with
Postgres, and I made a log of the install when finally succeded.

As this was a long time ago I can't remember how I went about it, but
maybe you will find something applicable to your problem in the log.

Akos




On 5/7/09, Simen Bjelke <s.bjelke at online.no> wrote:
Hi guys,
Although this isn't a metasploit specific question it is relevant, and maybe
someone else out there might also benefit from the answer. So here we go.

Having some issues setting up the postgresql database to use for autopwn
option.
I did the "gem install [postgresql] -> 1 gem installed", and verified with
"ruby -e 'require "rubygems"; require "postgres";'" But initdb command isn't
there. I've talked to some of the guys in #postgresql and they blame ruby
for this issue. What do you guys think and where should I start?
This is on Backtrack 4 - Beta

PS: Why are there no people on the silc channel, seems kinda redundant to
even promote it on the website when it's not in use. Wouldn't it be better
to start an IRC channel on freenode or something. I know some people get
chills even when they hear the word IRC, but I do believe it would gather a
larger crowd and essentially build a better community around the tool.

Regards
Simen Bjelke
_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework

-------------- next part --------------
MOUNT NTFS on Fedora 7
mount -t cifs -o username=admin,password=Pcmker98 //192.168.2.100/TEMP /mnt/winstuff



UPDATE RUBY, INSTALL RUBYGEMS

[root at localhost rubygems-0.9.5]# ruby setup.rb
./lib/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
        from ./lib/rubygems/custom_require.rb:27:in `require'
        from setup.rb:23
[root at localhost rubygems-0.9.5]# which ruby
/usr/bin/ruby
[root at localhost rubygems-0.9.5]# yum update ruby
Loading "installonlyn" plugin
Setting up Update Process
fedora                    100% |=========================| 2.1 kB    00:00
primary.sqlite.bz2        100% |=========================| 3.8 MB    00:32
updates                   100% |=========================| 2.3 kB    00:00
Resolving Dependencies
--> Running transaction check
---> Package ruby.i386 0:1.8.6.111-1.fc7 set to be updated
filelists.sqlite.bz2      100% |=========================| 4.4 MB    00:36
--> Processing Dependency: ruby-libs = 1.8.6.111-1.fc7 for package: ruby
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package ruby-libs.i386 0:1.8.6.111-1.fc7 set to be updated

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 ruby                    i386       1.8.6.111-1.fc7  updates           512 k
Updating for dependencies:
 ruby-libs               i386       1.8.6.111-1.fc7  updates           1.7 M

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       2 Package(s)
Remove       0 Package(s)

Total download size: 2.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): ruby-libs-1.8.6.11 100% |=========================| 1.7 MB    00:20
(2/2): ruby-1.8.6.111-1.f 100% |=========================| 512 kB    00:05
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora at redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
Is this ok [y/N]: y
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating  : ruby-libs                    ######################### [1/4]
  Updating  : ruby                         ######################### [2/4]
  Cleanup   : ruby                         ######################### [3/4]
  Cleanup   : ruby-libs                    ######################### [4/4]

Updated: ruby.i386 0:1.8.6.111-1.fc7
Dependency Updated: ruby-libs.i386 0:1.8.6.111-1.fc7
Complete!
[root at localhost rubygems-0.9.5]# ruby setup.rb
./lib/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
        from ./lib/rubygems/custom_require.rb:27:in `require'
        from setup.rb:23
[root at localhost rubygems-0.9.5]# yum install rubygems
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package rubygems.noarch 0:0.9.4-1.fc7 set to be updated
--> Processing Dependency: ruby-rdoc for package: rubygems
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package ruby-rdoc.i386 0:1.8.6.111-1.fc7 set to be updated
--> Processing Dependency: ruby-irb = 1.8.6.111-1.fc7 for package: ruby-rdoc
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package ruby-irb.i386 0:1.8.6.111-1.fc7 set to be updated

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 rubygems                noarch     0.9.4-1.fc7      updates           498 k
Installing for dependencies:
 ruby-irb                i386       1.8.6.111-1.fc7  updates            70 k
 ruby-rdoc               i386       1.8.6.111-1.fc7  updates           135 k

Transaction Summary
=============================================================================
Install      3 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 702 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): ruby-rdoc-1.8.6.11 100% |=========================| 135 kB    00:01
(2/3): rubygems-0.9.4-1.f 100% |=========================| 498 kB    00:03
(3/3): ruby-irb-1.8.6.111 100% |=========================|  70 kB    00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: ruby-irb                     ######################### [1/3]
  Installing: ruby-rdoc                    ######################### [2/3]
  Installing: rubygems                     ######################### [3/3]

Installed: rubygems.noarch 0:0.9.4-1.fc7
Dependency Installed: ruby-irb.i386 0:1.8.6.111-1.fc7 ruby-rdoc.i386 0:1.8.6.111-1.fc7
Complete!
[root at localhost rubygems-0.9.5]#    






INSTALL ACTIVERECORD

[root at localhost rubygems-0.9.5]# gem install activerecord
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find activerecord (> 0) in any repository
[root at localhost rubygems-0.9.5]# ruby setup.rb
install -c -m 0644 ubygems.rb /usr/lib/ruby/site_ruby/1.8/ubygems.rb
install -c -m 0644 rbconfig/datadir.rb /usr/lib/ruby/site_ruby/1.8/rbconfig/datadir.rb
install -c -m 0644 rubygems.rb /usr/lib/ruby/site_ruby/1.8/rubygems.rb
install -c -m 0644 rubygems/install_update_options.rb /usr/lib/ruby/site_ruby/1.8/rubygems/install_update_options.rb
install -c -m 0644 rubygems/gem_runner.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb
install -c -m 0644 rubygems/remote_installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb
install -c -m 0644 rubygems/rubygems_version.rb /usr/lib/ruby/site_ruby/1.8/rubygems/rubygems_version.rb
install -c -m 0644 rubygems/digest/sha2.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha2.rb
install -c -m 0644 rubygems/digest/digest_adapter.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/digest_adapter.rb
install -c -m 0644 rubygems/digest/sha1.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha1.rb
install -c -m 0644 rubygems/digest/md5.rb /usr/lib/ruby/site_ruby/1.8/rubygems/digest/md5.rb
install -c -m 0644 rubygems/remote_fetcher.rb /usr/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb
install -c -m 0644 rubygems/local_remote_options.rb /usr/lib/ruby/site_ruby/1.8/rubygems/local_remote_options.rb
install -c -m 0644 rubygems/indexer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/indexer.rb
install -c -m 0644 rubygems/open-uri.rb /usr/lib/ruby/site_ruby/1.8/rubygems/open-uri.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/ext
install -c -m 0644 rubygems/ext/configure_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/configure_builder.rb
install -c -m 0644 rubygems/ext/ext_conf_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/ext_conf_builder.rb
install -c -m 0644 rubygems/ext/rake_builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/rake_builder.rb
install -c -m 0644 rubygems/ext/builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb
install -c -m 0644 rubygems/doc_manager.rb /usr/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb
install -c -m 0644 rubygems/installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb
install -c -m 0644 rubygems/ext.rb /usr/lib/ruby/site_ruby/1.8/rubygems/ext.rb
install -c -m 0644 rubygems/config_file.rb /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb
install -c -m 0644 rubygems/validator.rb /usr/lib/ruby/site_ruby/1.8/rubygems/validator.rb
install -c -m 0644 rubygems/gem_open_uri.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_open_uri.rb
install -c -m 0644 rubygems/custom_require.rb /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
install -c -m 0644 rubygems/package.rb /usr/lib/ruby/site_ruby/1.8/rubygems/package.rb
install -c -m 0644 rubygems/platform.rb /usr/lib/ruby/site_ruby/1.8/rubygems/platform.rb
install -c -m 0644 rubygems/specification.rb /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb
install -c -m 0644 rubygems/server.rb /usr/lib/ruby/site_ruby/1.8/rubygems/server.rb
install -c -m 0644 rubygems/requirement.rb /usr/lib/ruby/site_ruby/1.8/rubygems/requirement.rb
install -c -m 0644 rubygems/dependency_list.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_list.rb
install -c -m 0644 rubygems/format.rb /usr/lib/ruby/site_ruby/1.8/rubygems/format.rb
install -c -m 0644 rubygems/gem_openssl.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_openssl.rb
install -c -m 0644 rubygems/command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb
install -c -m 0644 rubygems/security.rb /usr/lib/ruby/site_ruby/1.8/rubygems/security.rb
install -c -m 0644 rubygems/dependency.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb
install -c -m 0644 rubygems/version.rb /usr/lib/ruby/site_ruby/1.8/rubygems/version.rb
install -c -m 0644 rubygems/source_index.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb
install -c -m 0644 rubygems/old_format.rb /usr/lib/ruby/site_ruby/1.8/rubygems/old_format.rb
install -c -m 0644 rubygems/commands/cert_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/cert_command.rb
install -c -m 0644 rubygems/commands/specification_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/specification_command.rb
install -c -m 0644 rubygems/commands/outdated_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/outdated_command.rb
install -c -m 0644 rubygems/commands/contents_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/contents_command.rb
install -c -m 0644 rubygems/commands/fetch_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/fetch_command.rb
install -c -m 0644 rubygems/commands/check_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/check_command.rb
install -c -m 0644 rubygems/commands/server_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/server_command.rb
install -c -m 0644 rubygems/commands/cleanup_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/cleanup_command.rb
install -c -m 0644 rubygems/commands/install_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb
install -c -m 0644 rubygems/commands/generate_index_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/generate_index_command.rb
install -c -m 0644 rubygems/commands/list_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/list_command.rb
install -c -m 0644 rubygems/commands/mirror_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/mirror_command.rb
install -c -m 0644 rubygems/commands/pristine_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
install -c -m 0644 rubygems/commands/environment_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/environment_command.rb
install -c -m 0644 rubygems/commands/unpack_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/unpack_command.rb
install -c -m 0644 rubygems/commands/sources_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/sources_command.rb
install -c -m 0644 rubygems/commands/dependency_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/dependency_command.rb
install -c -m 0644 rubygems/commands/which_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/which_command.rb
install -c -m 0644 rubygems/commands/query_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/query_command.rb
install -c -m 0644 rubygems/commands/uninstall_command.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/commands/uninstall_command.rb
install -c -m 0644 rubygems/commands/update_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb
install -c -m 0644 rubygems/commands/build_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/build_command.rb
install -c -m 0644 rubygems/commands/rdoc_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/rdoc_command.rb
install -c -m 0644 rubygems/commands/help_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/help_command.rb
install -c -m 0644 rubygems/commands/lock_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/lock_command.rb
install -c -m 0644 rubygems/commands/search_command.rb /usr/lib/ruby/site_ruby/1.8/rubygems/commands/search_command.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/indexer
install -c -m 0644 rubygems/indexer/marshal_index_builder.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/indexer/marshal_index_builder.rb
install -c -m 0644 rubygems/indexer/quick_index_builder.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/indexer/quick_index_builder.rb
install -c -m 0644 rubygems/indexer/abstract_index_builder.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/indexer/abstract_index_builder.rb
install -c -m 0644 rubygems/indexer/master_index_builder.rb 
/usr/lib/ruby/site_ruby/1.8/rubygems/indexer/master_index_builder.rb
install -c -m 0644 rubygems/timer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/timer.rb
install -c -m 0644 rubygems/command_manager.rb /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb
install -c -m 0644 rubygems/uninstaller.rb /usr/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb
install -c -m 0644 rubygems/dependency_installer.rb /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb
install -c -m 0644 rubygems/version_option.rb /usr/lib/ruby/site_ruby/1.8/rubygems/version_option.rb
install -c -m 0644 rubygems/gem_path_searcher.rb /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb
install -c -m 0644 rubygems/exceptions.rb /usr/lib/ruby/site_ruby/1.8/rubygems/exceptions.rb
install -c -m 0644 rubygems/source_info_cache.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb
install -c -m 0644 rubygems/user_interaction.rb /usr/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb
install -c -m 0644 rubygems/source_info_cache_entry.rb /usr/lib/ruby/site_ruby/1.8/rubygems/source_info_cache_entry.rb
install -c -m 0644 rubygems/builder.rb /usr/lib/ruby/site_ruby/1.8/rubygems/builder.rb
cp gem /tmp/gem
install -c -m 0755 /tmp/gem /usr/bin/gem
rm /tmp/gem
cp update_rubygems /tmp/update_rubygems
install -c -m 0755 /tmp/update_rubygems /usr/bin/update_rubygems
rm /tmp/update_rubygems
rm /usr/lib/ruby/gems/1.8/source_cache
Removing old RubyGems RDoc and ri...
rm -rf /usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4
Installing rubygems-0.9.5 ri into /usr/lib/ruby/gems/1.8/doc/rubygems-0.9.5/ri...
Installing rubygems-0.9.5 rdoc into /usr/lib/ruby/gems/1.8/doc/rubygems-0.9.5/rdoc...
As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)...
...done.
No library stubs found.
[root at localhost rubygems-0.9.5]# gem install activerecord
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed activesupport-1.4.4
Successfully installed activerecord-1.15.6
2 gems installed
Installing ri documentation for activesupport-1.4.4...
Installing ri documentation for activerecord-1.15.6...
Installing RDoc documentation for activesupport-1.4.4...
Installing RDoc documentation for activerecord-1.15.6...
[root at localhost rubygems-0.9.5]#





UPDATE POSTGRESQL

[root at localhost rubygems-0.9.5]# gem install postgres
Building native extensions.  This could take a while...
ERROR:  Error installing postgres:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install postgres
can't find header files for ruby.


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/gem_make.out
[root at localhost rubygems-0.9.5]# yum install pqsql
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
Nothing to do
[root at localhost rubygems-0.9.5]# which pgsql
/usr/bin/which: no pgsql in 
(/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)
[root at localhost rubygems-0.9.5]# yum install postgres
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
Nothing to do
[root at localhost rubygems-0.9.5]# yum install postgresql
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package postgresql.i386 0:8.2.5-1.fc7 set to be updated
--> Processing Dependency: postgresql = 8.2.3-2.fc7 for package: postgresql-server
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package postgresql-server.i386 0:8.2.5-1.fc7 set to be updated

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 postgresql              i386       8.2.5-1.fc7      updates           3.0 M
Updating for dependencies:
 postgresql-server       i386       8.2.5-1.fc7      updates           4.0 M

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       2 Package(s)
Remove       0 Package(s)

Total download size: 7.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): postgresql-server- 100% |=========================| 4.0 MB    00:33
(2/2): postgresql-8.2.5-1 100% |=========================| 3.0 MB    00:24
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating  : postgresql                   ######################### [1/4]
  Updating  : postgresql-server            ######################### [2/4]
  Cleanup   : postgresql                   ######################### [3/4]
  Cleanup   : postgresql-server            ######################### [4/4]

Updated: postgresql.i386 0:8.2.5-1.fc7
Dependency Updated: postgresql-server.i386 0:8.2.5-1.fc7
Complete!
[root at localhost rubygems-0.9.5]# gem install postgres
Updating metadata for 5 gems from http://gems.rubyforge.org
....
complete
Building native extensions.  This could take a while...
ERROR:  Error installing postgres:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install postgres
can't find header files for ruby.


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/gem_make.out
[root at localhost rubygems-0.9.5]# 





INSTALL RUBY-DEVEL



[root at localhost rubygems-0.9.5]# gem install postgres --install-dir /usr/lib/ruby/1.8
Building native extensions.  This could take a while...
ERROR:  Error installing postgres:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install postgres --install-dir /usr/lib/ruby/1.8
can't find header files for ruby.


Gem files will remain installed in /usr/lib/ruby/1.8/gems/postgres-0.7.1 for inspection.
Results logged to /usr/lib/ruby/1.8/gems/postgres-0.7.1/gem_make.out
[root at localhost rubygems-0.9.5]# gem install postgres --with-ruby-lib-dir=/usr/lib/ruby/1.8
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --with-ruby-lib-dir=/usr/lib/ruby/1.8
[root at localhost rubygems-0.9.5]# gem install postgres --with-pgsql-lib-dir=/usr/lib/pgsql
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --with-pgsql-lib-dir=/usr/lib/pgsql
[root at localhost rubygems-0.9.5]# yum install ruby-devel
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
fedora                    100% |=========================| 2.1 kB    00:00
updates                   100% |=========================| 2.3 kB    00:00
Resolving Dependencies
--> Running transaction check
---> Package ruby-devel.i386 0:1.8.6.111-1.fc7 set to be updated

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 ruby-devel              i386       1.8.6.111-1.fc7  updates           563 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 563 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): ruby-devel-1.8.6.1 100% |=========================| 563 kB    00:04
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: ruby-devel                   ######################### [1/1]

Installed: ruby-devel.i386 0:1.8.6.111-1.fc7
Complete!
[root at localhost rubygems-0.9.5]# gem install postgres
Building native extensions.  This could take a while...
ERROR:  Error installing postgres:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install postgres
checking for cygwin32_socket() in -lwsock32... no
checking for socket() in -lsocket... no
checking for gethostbyname() in -linet... no
checking for gethostbyname() in -lnsl... yes
checking for sys/un.h... yes
checking for socket()... yes
checking for hsterror()... no
checking for gethostname()... yes
checking for PQsetdbLogin() in -lpq... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-pgsql-dir
        --without-pgsql-dir
        --with-pgsql-include
        --without-pgsql-include=${pgsql-dir}/include
        --with-pgsql-lib
        --without-pgsql-lib=${pgsql-dir}/lib
        --with-wsock32lib
        --without-wsock32lib
        --with-socketlib
        --without-socketlib
        --with-inetlib
        --without-inetlib
        --with-nsllib
        --without-nsllib
        --with-pgsql-include-dir
        --without-pgsql-include-dir
        --with-pgsql-lib-dir
        --without-pgsql-lib-dir
        --with-pqlib
        --without-pqlib
Could not find PostgreSQL libraries: Makefile not created


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/gem_make.out
[root at localhost rubygems-0.9.5]#    







POSTGRESQL INSTALL (FROM SOURCE)
(header files would be needed for installing ruby postgres plugin, but there's no)
-downloaded from Posgres website
-executed the following commands:

./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb t




RUBY PLUGIN FOR POSTGRES INSTALL

[root at localhost rubygems-0.9.5]# gem install postgres -- --with-pgsql-include-dir=/usr/local/pgsql/include 
--with-pgsql-lib-dir=/usr/local/pgsql/lib
Updating metadata for 8 gems from http://gems.rubyforge.org
........
complete
Building native extensions.  This could take a while...
Successfully installed postgres-0.7.1
1 gem installed
[root at localhost rubygems-0.9.5]#   


ADD ROOT USER TO POSTGRES

-bash-3.2$ createuser root
Shall the new role be a superuser? (y/n) y
CREATE ROLE

START METASPLOITDB DATABASE

[root at localhost ~]# su - postgres
-bash-3.2$ pg_ctl -D metasploitdb start
server starting


MAKE SURE THAT NMAP IS INSTALLED !!!!!!!!!!!!
(otherwise db_create will run, but db_nmap will produce no output and will not run



SETUP POSTGRES DATABASE REMOTE ACCESS(ON PORT 5432)

/var/lib/pgsql/metasploitdb - here are the configuration files
pg_hba.conf - you can set the which addresses postgres will accept connections from
postgresql.conf - you have to uncomment two lines :

listen_addresses = '*'                  # what IP address(es) to listen on; 
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                             # (change requires restart)

and restart the server :
pg_ctl -D metasploitdb stop
pg_ctl -D metasploitdb start



INSTALL RUBY-TCLTK (without screwing up dependencies and metasploit)

yum install ruby-tcltk
you musn't compile tcltk from source, because then you have to recompile ruby and that screws up ruby postgres plugin 
which will make Metasploit not to work. !!!!


Current thread: