Strony

Pokazywanie postów oznaczonych etykietą Fedora 12. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą Fedora 12. Pokaż wszystkie posty

czwartek, 22 kwietnia 2010

Welcome to Fedora 12!

I had tried to install Fedora 6 on my MacBook Pro 2-3 years ago but those days you have to hack to many things inside the kernel and config, that I gave up after one week of struggling. So, I have to use this %$#$%@ MacOSX, which looks like OS for emo teenager. I mean this young true emo kid, who is cutting himself with a pink razor to see his own artificial blood made of ketchup shouting and crying about Miss Spears private and public life. All this fancy jumping and zooming in and out icons and all this very deeply hidden options/configuration files...

Hopefully in the meantime good guys from Fedora were working on a new releases. And once Fedora 12 was released (well, I should say once I have realised it) I had gazed my eyes onto it eager to try it out once again. So I've downloaded x86_64 DVD ISO image, burned it and kept it at my fingertips, but the next step was o download and install in MacOSX small application called rEFIt. Afterwards I've downloaded and burned ISO image of gparted, moved, just for curiosity all my files to external USB hard drive and the repartitioning started straight away... I have shrunk main HD hpfs+ partition to 20 GB and created small /boot (300 MB), bigger /root (30GB) and rather huge /home (the rest) partitions, all using ext4 format. I've also created really small swap (2GB) at the very end of disk.

Then I put Fedora 12 installation DVD into slot and installation started. When it completed new lovely Tux has shown up under rEFIt menu just after resyc'ing HD master boot record with GUID. Then I logged to MacOSX once again only for changing boot options and choosing Fedora by default. I can't remember what I exactly did, but all details are in rEFIt documentation.

And then I've rebooted my laptop once again waiting with my fingers crossed to boot into Fedora 12 for the very first time.

What works out of the box? Built-in camera, track pad, ethernet and wireless cards, graphic adapter, special keys for LCD brightness, sound volume and keyboard backlight.

For the sound I have to tweak it a little putting into
/etc/modprobe.d/sound file this config:

alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel model=mbp3

and reboot it once.

Then I set up Polish keyboard mapping (System → Preferences → Keyboard → Layout → Add and look for Polish, then modify Options for input of Polish characters, AFAIR I've ticked "Any ALT key" in "Key to choose 3rd level" option). Et voila: ąśźżłóę. :)

Then I went to standard procedure of installation of VERY IMPORTANT APPS (krb5, openafs, LDAP for Thunderbird etc.) googling for their configuration in cern.ch domain.

And that's it! Since one month I'm working on Fedora 12. And I'm very happy!

Post-installation took me some more time, especially that Fedora guys are really good guys and they're not distributing any piece of code which has got some problem with the Law (so i.e. there are no mp3 codecs in official Fedora yum repos etc.). Fortunately all is quite good documented on Internet by not-so-good guys and easy to find thanks to Google, Inc.

Farewell MacOSX! Never see you again! Never ever come back!!!

wtorek, 16 marca 2010

CherryPy behind blue eyes of apache

Well, a big change is coming. We are going to switch our web app from PHP+jQuery to CherryPy+jQuery+some kind of ORM+some db back-end (and with a little intrusion of PHP, but #!).

It won't be easy... First of all I've put all parts of a new system together:

  • CherryPy 3.1.2 for "pythonization"
  • SQLObject 0.10.2 as out ORM
  • Cheetah 2.2.2 for templates
  • sqlite or mysql for db back-end (still not decided)


I want to run CherryPy application in a standalone server, probably as a deamon, on our www host and communicate with it using apache + mod_proxy.


  1. deamonization

    Sound easy but it took me two days to understand cherryd usage. After that I've wrote a shell script to run my CherryPy application as a deamon under Fedora (I hope it would work also under RHEL..):


    #!/bin/sh
    #
    # Comments to support chkconfig on RedHat Linux
    # chkconfig: 35 96 96
    # description: Cherrypy start/stop script
    #
    #
    ### BEGIN INIT INFO
    # Provides: cherrypy
    # Required-Start: $local_fs $syslog
    # Required-Stop: $local_fs $syslog
    # Default-Start: 2345
    # Default-Stop: 90
    # Short-Description: run CherryPy web server
    # Description: CherryPy is a python framerwork for CMT
    #
    ### END INIT INFO

    . /etc/init.d/functions

    serverdir=/home/cibak/CheRTTyPy
    prog=get
    server=${serverdir}/get.py
    config=${serverdir}/conf/get.conf
    pidfile=${PIDFILE-/var/run/CheRTTyPy.pid}
    lockfile=${LOCKFILE-/var/lock/subsys/CheRTTy}

    PYTHONPATH=${serverdir}

    RETVAL=0

    start() {
    echo -n "Starting $prog:"
    cherryd -d -p ${pidfile} -c ${config} -i get
    RETVAL=$?
    [ $RETVAL = 0 ] && touch ${lockfile}
    echo_success
    echo
    return $RETVAL
    }

    stop() {
    echo -n "Stopping $prog:"
    if test -f ${pidfile}; then
    killproc -p ${pidfile} -d 10 $prog
    rm -f "$pidfile"
    RETVAL=$?
    else
    RETVAL=1
    fi
    RETVAL=$?
    echo_success
    echo
    [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
    }


    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    status -p ${pidfile} $server
    RETVAL=$?
    ;;
    restart)
    stop
    start
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart|status}"
    exit 1
    esac
    exit $RETVAL


  2. apache and mod_proxy

    I want to run CherryPy app behind apache and use mod_proxy to redirect ajax calls to it. So the vhost configuration:


    <VirtualHost cibak.fedora12.mbp:443>
    ServerAdmin krzysztof.ciba@xxxxxxxxx.xxx
    ServerName cibak.fedora12.mbp
    ProxyPreserveHost On

    DocumentRoot /home/cibak/CheRTTyPy
    ErrorLog logs/cibak.fedora12.mbp_error.log
    TransferLog logs/cibak.fedora12.mbp_access.log

    SSLEngine On
    SSLProtocol all -SSLv2
    SSLProxyEngine On

    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW

    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

    <Proxy *>
    Order allow,deny
    Allow from all
    </Proxy>
    ProxyPass /query/ https://127.0.0.1:8083/
    ProxyPassReverse /query/ https://127.0.0.1:8083/
    </VirtualHost>


  3. ORM
    SQLObject, looks pretty nice, especially sqlbuilder classes for constructing SQL query. For prototype I choose simple sqlite3 DB-API, as it is already built in python, but for production version I'll switch to ORACLE or mysql.

    BTW switch of db back-end is very easy with SQLObject ORM — only place for that is changing connection string passed to sqlconnector. :)


After 6-7 weeks of rather extensive work the prototype for Atlas experiment RTT web page is ready and released to the public. Now I'm waiting for the feedback.



!!!WORK IN PROGRESS!!!