Wednesday 20 November 2013

Fedora Package Database Installation - From Beginning to as far as I got

1.      Get the package database:

·         git clone https://github.com/fedora-infra/packagedb.git

2.      Install the needed packages:

·         yum -y install python-genshi TurboGears python-turbojson postgresql-server \
        postgresql-contrib python-TurboMail python-bugzilla python-fedora \
        python-psycopg2 python-sqlalchemy python-feedparser koji mod_wsgi \
        python-paver httpd mod_ssl babel python-cpio xz python-argparse \
        python-mako python-memcached py
NOTE: if you are running on fedora install python-fedora-turbogears by issuing command “yum install python-fedora-turbogears”

3.      go to packaged “cd packagedb”

·         python setup.py egg_info (you will get a few warnings ignore them)
           NOTE:please do a yum update before doing this.

4.     Copy paver to your current directory and renaming  it to paver.local
·         cp /usr/bin/paver paver.local

5.      Run this complicated command (copy/paste it carefully so only the code gets copied)
·         sed 's/__requires__ = .*/__requires__ = ["Paver", "CherryPy < 3.0"]/' < paver.local > paver

6.       Build the package:
·         paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`

7.      start the postgresql service if it is not already started by issuing
·         service postgresql initdb
·         start the service using "service postgresql start"

8.      Create postgresql users: 

sudo -u postgres createuser -SDRPE pkgdbadmin
        Enter password for new role: <password>
        Enter it again: <password>
        sudo -u postgres createuser -SDRPE pkgdbreadonly
        Enter password for new role: <password>
        Enter it again: <password>

Get the most recent dump from the same website you grabbed fedora package from. so go to https://fedorahosted.org/releases/p/a/packagedb and download the most recent ".dump.xz" file

then run this command to import it all to the database:

xzcat pkgdb-20100318.dump.xz | sudo -u postgres psql
NOTE: this can take a while, no, rather this will take a while - give it about 3-4 hours if you are running it on a virtual machine.

9.       Run this command
·            sudo -u postgres psql pkgdb < update-schema/03_add_gitbranchname.sql

10.     Memcached is an optional daemon that can be run to speed up the server.  It functions by caching certain data that is read many times so that we don't have to access the database as frequently.  To use it you need to install and start it

·               su -c yum install memcached
·               su -c /etc/init.d/memcached start

11.      Move pkgdb.cfg.sample to pkgdb.cfg
·               mv pkgdb.cfg.sample pkgdb.cfg

12.      Modify the pkgdb.cfg file
·                  sqlalchemy.dburi="postgres://pkgdbadmin:(password)@localhost/pkgdb"
·            server.static_media_dir="(the path to packagedb directory e.g /home/hitman/packaged)"

13.      Modify /etc/httpd/conf/httpd.conf
·          vi /etc/httpd/conf/httpd.conf
        <Directory "/home/hitman/packagedb">
            AllowOverride None
            Options None
            Order allow,deny
            Allow from all
          </Directory>

14.    Turn SELINUX in permissive mode (just to check)
·      setenforce 0

15. Copy the httpd-pkgdb.conf file to your apache conf.d directory

·      sudo cp httpd-pkgdb.conf /etc/httpd/conf.d/

16.    Restart httpd server
·      service httpd restart

17.    ATTEMPT to access the Fedora Package Database Webpage
·         https://localhost/pkgdb/

18. Get the errors from the error log and try to resolve them.
·         tail /etc/httpd/logs/ssl_error_log

[Tue Nov 19 23:09:07.816671 2013] [:error] [pid 2494] [remote ::1:6073] mod_wsgi (pid=2494): Target WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi' cannot be loaded as Python module.
[Tue Nov 19 23:09:07.816714 2013] [:error] [pid 2494] [remote ::1:6073] mod_wsgi (pid=2494): Exception occurred processing WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi'.
[Tue Nov 19 23:09:07.816733 2013] [:error] [pid 2494] [remote ::1:6073] Traceback (most recent call last):
[Tue Nov 19 23:09:07.816757 2013] [:error] [pid 2494] [remote ::1:6073] File "/home/hitman/Public/packagedb/pkgdb.wsgi", line 24, in
[Tue Nov 19 23:09:07.816809 2013] [:error] [pid 2494] [remote ::1:6073] modulename="pkgdb.config")
[Tue Nov 19 23:09:07.816821 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 219, in update_config
[Tue Nov 19 23:09:07.816892 2013] [:error] [pid 2494] [remote ::1:6073] configdict = config_obj(configfile, modulename).dict()
[Tue Nov 19 23:09:07.816904 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 174, in config_obj
[Tue Nov 19 23:09:07.816923 2013] [:error] [pid 2494] [remote ::1:6073] modname + '.cfg')
[Tue Nov 19 23:09:07.816933 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in resource_filename
[Tue Nov 19 23:09:07.817317 2013] [:error] [pid 2494] [remote ::1:6073] return get_provider(package_or_requirement).get_resource_filename(
[Tue Nov 19 23:09:07.817329 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 180, in get_provider
[Tue Nov 19 23:09:07.817345 2013] [:error] [pid 2494] [remote ::1:6073] import(moduleOrReq)
[Tue Nov 19 23:09:07.817360 2013] [:error] [pid 2494] [remote ::1:6073] ImportError: No module named pkgdb


This is how far I got when installing Fedora Package Datbase.





No comments:

Post a Comment

How to add "Discord" in Steam's Big Picture Mode

 With the release of Steam deck a lot of people are turning into Steam Deck Big Picture Mode(BPM) to enjoy an exclusive gaming experience, t...