Wednesday, March 13, 2013

Timeline for DurusWorks Installation

I should not have upgraded the working old version of QP/QPY but I was severely tempted to do so after updating the Operating System. The new QP/QPY/Durus package is now named DurusWorks, includes Sancho, Dulcinea
  • March 13, 2013
  • The software is hosted at Mems-Exchange. According to the documentation, the steps to to define a new site named named hello, is to start with a copy of the proto site:
    mkdir /www
    mkdir /www/trunk
    cp -r /www/trunk/DurusWorks/proto /www/trunk/hello 
    ln -s /www/trunk/hello/lib /www/pythonlib/hello 
    ln -s /www/trunk/hello/site /www/qp_sites/hello 
    
    Edit /www/trunk/hello/lib/ui/slash.qpy to configure the service addresses (I did not change the defaults) Edit /www/trunk/hello/site/slash.py and change the import to this:
    from hello.ui.slash import SitePublisher, SiteDirectory 
    
    I got the following when starting the qp server.
    > qp start
    Using Python base classes for persistence.
    Could not find sites in any of these places:
       /www/qp_sites
       /usr/local/lib/python2.7/dist-packages/qp/sites
    
    Interestingly I get the following output when invoking qpcheck.py:
    > qpcheck.py
    ./trunk/hello/lib/ui/slash.qpy: 'SitePublisher' is unused
    ./trunk/hello/lib/ui/slash.qpy: 'SiteDirectory' is unused
    
    Here is the directory structure of the /www
    $ ls -alR /www/*
    /www/pythonlib:
    total 8
    drwxr-xr-x 2 root root 4096 Mar 13 17:21 .
    drwxr-xr-x 5 root root 4096 Mar 13 17:20 ..
    lrwxrwxrwx 1 root root   15 Mar 13 17:21 hello -> trunk/hello/lib
    
    /www/qp_sites:
    total 8
    drwxr-xr-x 2 root root 4096 Mar 13 17:22 .
    drwxr-xr-x 5 root root 4096 Mar 13 17:20 ..
    lrwxrwxrwx 1 root root   16 Mar 13 17:22 hello -> trunk/hello/site
    
    /www/trunk:
    total 12
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 5 root root 4096 Mar 13 17:20 ..
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 hello
    
    /www/trunk/hello:
    total 24
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 ..
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 conf
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 doc
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 lib
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 site
    
    /www/trunk/hello/conf:
    total 12
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root 1070 Mar 13 17:19 apache2_proto.conf
    
    /www/trunk/hello/doc:
    total 12
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root   11 Mar 13 17:19 doc.txt
    
    /www/trunk/hello/lib:
    total 16
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root  149 Mar 13 17:19 __init__.py
    drwxr-xr-x 3 root root 4096 Mar 13 21:27 ui
    
    /www/trunk/hello/lib/ui:
    total 48
    drwxr-xr-x 3 root root 4096 Mar 13 21:27 .
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root 3712 Mar 13 17:19 forms.qpy
    -rw-r--r-- 1 root root  229 Mar 13 17:19 __init__.py
    -rw-r--r-- 1 root root 3665 Mar 13 17:19 qwiki.qpy
    -rw-r--r-- 1 root root 9662 Mar 13 21:27 slash.qpy
    -rw-r--r-- 1 root root 9661 Mar 13 17:28 slash.qpy~
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 static
    
    /www/trunk/hello/lib/ui/static:
    total 24
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 3 root root 4096 Mar 13 21:27 ..
    -rw-r--r-- 1 root root 1054 Mar 13 17:19 all.css
    -rwxr-xr-x 1 root root 3638 Mar 13 17:19 favicon.ico
    -rw-r--r-- 1 root root   82 Mar 13 17:19 favicon.png
    -rw-r--r-- 1 root root 1450 Mar 13 17:19 proto.js
    
    /www/trunk/hello/site:
    total 16
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root  150 Mar 13 17:19 __init__.py
    -rw-r--r-- 1 root root   86 Mar 13 17:19 slash.py
    $ 
    
    I wonder what is wrong!
  • March 15, 2013
  • I followed to the letter the "standard installation" procedure published in https://www.mems-exchange.org/software/DurusWorks/DurusWorks-1.1.tar.gz/DurusWorks-1.1/doc/DurusWorks.html The problem in installation was that the scgi modules wanted the apxs compiler. We temporarily ignore this scgi and let qp serve pages temporarily. Now our problem is configuring with Apache2. I get the following error when restarting the web server!
     sudo /etc/init.d/apache2 restart
    [Fri Mar 15 16:12:50 2013] [warn] module scgi_module is already loaded, skipping
    [Fri Mar 15 16:12:50 2013] [warn] module scgi_module is already loaded, skipping
    [Fri Mar 15 16:12:50 2013] [warn] module scgi_module is already loaded, skipping
    Syntax error on line 35 of /www/conf/apache2_proto.conf:
    Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
    Action 'configtest' failed.
    The Apache error log may have more information.
       ...fail!
    
    It turned out that I have not enabled mod_ssl! just type sudo a2enmod ssl. but that is not all, the server will look for a certificate and key! Please read the instructions to do this from help.ubuntu.com The commands I typed were (you have to do this one line at a time!)
      openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
      openssl genrsa -des3 -out server.key 1024
      openssl rsa -in server.key -out server.key.insecure
      mv server.key server.key.secure
      mv server.key.insecure server.key
      openssl req -new -key server.key -out server.csr
      mv server.csrt server.crt
      mv server.csr server.crt
    
    Then restart the apache server.

1 comment: