-- AdriaCasajus - 12 Feb 2008

Apache + mod_python + Pylons + DIRAC

Required packages

  • httpd-devel
  • httpd
  • mod_ssl
  • gcc
  • gcc-c++
  • zlib
  • zlib-devel
  • unzip

Prepare DIRAC

Compile python if it's not there

For Python2.5

<DIRACROOT>/external/sqlite-3.5.4/dirac-make
<DIRACROOT>/external/Python-2.5/dirac-make
<DIRACROOT>/contrib/pyGSI/dirac-make

For Python2.4

<DIRACROOT>/external/Python-2.4.4/dirac-make
<DIRACROOT>/contrib/pyGSI/dirac-make

Install Pylons

<DIRACROOT>/<DIRACARCH>/bin/easy_install Pylons
If easy_install is absent you have to download file ez_setup from http://peak.telecommunity.com/dist/ez_setup.py (temporary link), and execute it by hand
<DIRACROOT>/<DIRACARCH>/bin/python ez_setup.py
Repeat step with Pylons installation

Grid Requirements

In order to only allow valid certificates apache needs a CA directory (with CAs and CRLs updated periodically) and a certificate.

Setting up Apache

Install mod_python

<DIRACROOT>/external/mod_python/dirac-make 
cp <DIRACROOT>/DIRAC/Interfaces/Web/wgsi.py <DIRACROOT>/<DIRACARCH>/lib/python<PYTHONVERSION>/site-packages/mod_python

Prepare DIRAC web root

  • Create the web root directory
mkdir -p /opt/dirac/webRoot/
  • Create the index.html file (vi /opt/dirac/webRoot/index.html)
<html>
 <head>
  <META http-equiv="refresh" content="0; URL=DIRAC">
 </head>
</html>
  • Create a link to the DIRAC web root
ln -s <DIRACROOT>/DIRAC/Interfaces/Web/ /opt/dirac/webRoot/DIRAC

Configure Apache

Under SLC4 apache configuration file is /etc/httpd/conf/httpd.conf

  • Load mod_python
LoadModule python_module modules/mod_python.so
  • Set the desired directory as the Apache document root
DocumentRoot "/opt/dirac/webRoot"
  • Define mod_python as the handler for the DIRAC web directory
<Directory "/opt/dirac/webRoot/DIRAC">
  SetHandler mod_python
  PythonHandler mod_python.wsgi
  PythonPath "['/opt/dirac/DIRAC3/DIRAC/Interfaces/Web'] + sys.path"
  PythonOption wsgi.application startup::app
  PythonOption SCRIPT_NAME /DIRAC
</Directory>

Configuring mod_ssl

Under SLC4 mod_ssl configuration file is /etc/httpd/conf.d/ssl.conf and it has to have defined the following settings:

  • SSLCertificateFile /pathto/certfile
  • SSLCertificateKeyFile /pathto/keyfile
  • SSLCACertificatePath /etc/grid-security/certificates
  • SSLCARevocationPath /etc/grid-security/certificates
  • SSLVerifyClient require
  • SSLVerifyDepth 10
  • SSLOptions +StdEnvVars
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r5 - 2008-09-30 - MatveySapunov
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback