Changes between Version 74 and Version 75 of Dev/GettingStarted


Ignore:
Timestamp:
06/21/11 17:24:30 (2 years ago)
Author:
gcerto
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Dev/GettingStarted

    v74 v75  
    66 * A computer running any modern Linux distribution or Windows (Mac OS X should work, although none of us have tested it). Most of the CERN Indico development team is currently using Ubuntu, so unless you have strong feelings otherwise, you might make your life easier by installing it. 
    77 * The following software (Ubuntu package names listed in square brackets - use Synaptic Package Manager to find and install them) 
    8    * Python 2.xx (2.6 or greater advised) [python](Windows users: there is [and probably there won't be] no mod_python supporting Python 2.6+. Recommended version for Windows is 2.5) 
     8   * Python 2.xx (2.6 or greater advised) [python] 
    99   * Python development packages [python-dev]  
    1010   * Apache httpd 2.2 or greater (make sure to use the pre-fork package!) [apache2-mpm-prefork] 
    11    * mod_python 3.3 or greater [libapache2-mod-python] 
     11   * mod_wsgi 3.3 or greater [libapache2-mod-wsgi] 
    1212   * git [git-core] 
    1313   * gettext package [gettext] 
     
    6969== 2. Preparing the Development Environment == 
    7070 
    71 Indico requires some dependencies (libraries, etc...) that the setup.py installation script installs automatically, with the exception of !ReportLab, libxml2 and libxslt (which you have already installed manually). There's no need to worry about them, but if you want to know more about these dependencies, see [wiki:Admin/Installation#Dependencies]. 
    72  
    73 Before running setup.py, you may want to switch to the most recent branch, for example v0.97-series. If you did not do this yet, you should still be in the "master" branch. You can verify this with: 
     71Indico requires some dependencies (libraries, etc...) that the setup.py installation script installs automatically, with the exception of ReportLab, libxml2 and libxslt (which you have already installed manually). There's no need to worry about them, but if you want to know more about these dependencies, see [wiki:Admin/Installation0.98]. 
     72 
     73Before running setup.py, you may want to switch to the most recent branch, for example v0.98-series. If you did not do this yet, you should still be in the "master" branch. You can verify this with: 
    7474{{{ 
    7575jdoe@localhost ~/indico/cds-indico$ git status 
     
    7979To change to the most recent branch, first fetch it: 
    8080{{{ 
    81 jdoe@localhost ~/indico/cds-indico$ git fetch origin v0.97-series:v0.97-series 
     81jdoe@localhost ~/indico/cds-indico$ git fetch origin v0.98-series:v0.98-series 
    8282From http://cdsware.cern.ch/repo/cds-indico 
    83  * [new branch]      v0.97-series -> v0.97-series 
     83 * [new branch]      v0.98-series -> v0.98-series 
    8484}}} 
    8585and then switch (checkout) to it: 
    8686{{{ 
    87 jdoe@localhost ~/indico/cds-indico$ git checkout v0.97-series 
     87jdoe@localhost ~/indico/cds-indico$ git checkout v0.98-series 
    8888}}} 
    8989Finally, check that you are correctly in the target branch: 
    9090{{{ 
    9191jdoe@localhost ~/indico/cds-indico$ git status 
    92 # On branch v0.97-series 
     92# On branch v0.98-series 
    9393nothing to commit (working directory clean) 
    9494}}} 
     
    169169However if you wish to commit a change later you will need to undo this with git update-index --no-assume-unchanged. 
    170170 
    171 === Set up mod_python === 
    172  
    173 The information in this section was condensed from the following page: [[Configuring and testing mod_python]]. The page requires a login and probably isn't necessary. 
    174  
    175 Locate the apache2 configuration file (httpd.conf or apache2.conf). In Linux, it is located in /etc/apache2/. 
    176 Enable mod_python: 
    177  
    178     * Windows users: add the following line to the Apache conf file:  
    179  
    180 {{{ 
    181 LoadModule python_module modules/mod_python.so 
    182 }}} 
    183  
    184     * Linux users: If you have installed Apache and mod_python from packages, adding this line should not be necessary. 
    185  
    186 Windows users will need to edit/config the file httpd.conf. Linux (Ubuntu) users will need to create a file inside sites-available (and a symbolic link to it in sites-enabled) with the following content. 
    187  
    188 Make sure this lines appear in the Apache configuration file: 
    189 {{{ 
    190         ServerName myservername.cern.ch 
    191         ServerAdmin your.email@cern.ch 
    192  
    193         DocumentRoot /home/jdoe/cds-indico/indico/htdocs 
    194         directoryIndex index.py index.html 
    195  
    196         SetEnv PYTHON_EGG_CACHE /tmp/.python-eggs 
    197 }}} 
    198  
    199 Add the following to make Apache re-route JSON-RPC requests to the json-rpc-handler.py file located in htdocs. Make sure this <Directory> entry appears BEFORE the <Directory> entry found below. 
    200  
    201 {{{ 
    202 <Directory "/home/jdoe/indico/cds-indico/indico/htdocs/services"> 
    203     PythonPath "sys.path+['/home/jdoe/indico/cds-indico/indico','/home/jdoe/indico/cds-indico/indico/htdocs']" 
    204     SetHandler python-program 
    205     PythonHandler MaKaC.services.handler 
    206     Allow from All 
    207 </Directory> 
    208 }}} 
    209  
    210 Add the following text so that Apache will interpret all the files in htdocs as Python script files. 
    211  
    212 {{{ 
    213 <Directory "/home/jdoe/indico/cds-indico/indico/htdocs"> 
    214     AddHandler python-program .py 
    215     PythonHandler mod_python.publisher 
    216     PythonDebug On 
    217     PythonPath "sys.path+['/home/jdoe/indico/cds-indico/indico']" 
    218     Allow from All  
    219 </Directory> 
    220 }}} 
    221  
    222 Change the above directories to match your installation. 
    223  
    224 Here's an explanation of the above lines from a non-English speaker for your amusement: 
    225  
    226     * Directory: the directory whose files you want to be interpreted as python files. In Indico, it's the htdocs directory. 
    227     * !AddHandler: it tells apache to interpret .py files as python files. 
    228     * !PythonHander: mod_python has several handlers available. Depending of the handler, the methods of the .py files have to be different. In Indico, we use mod_python.publisher as handler. 
    229     * !PythonDebg On: if there is an exception, you will see the trace in your browser. 
    230     * !PythonPath: adds the rest of the Indico classes (in other directories than htdocs) toApache's python path (not the system global path!), so that the htdocs files can call files from other directories. 
    231     * !PythonAutoReloadOff: I don't know!  
    232  
    233 Add the following lines, in this order: 
    234 {{{ 
    235 Alias /indico/images "/home/jdoe/indico/cds-indico/indico/htdocs/images" 
    236 Alias /indico/js "/home/jdoe/indico/cds-indico/indico/htdocs/js" 
    237 Alias /indico "/home/jdoe/indico/cds-indico/indico/htdocs" 
    238 }}} 
     171=== Set up mod_wsgi === 
     172 
     173From the version v0.98, Indico is running with mod_wsgi and not with mod_python anymore. If you already have a previous installation of Indico with mod_python, you should first remove it before starting the mod_wsgi installation and configuration. If this is your case, you should first take a look at the following page [wiki:Admin/Installation0.98#a3.1Removingmod_python removing mod_python]. 
     174 
     175Once mod_python totally removed from your configuration you can proceed by installing mod_wsgi. The following steps will concern only the configuration in Linux, you can refer to this page to have the details about the configuration in Windows: [wiki:Admin/Installation0.98#a3.2.2.InstallationonWindows Windows config]. 
     176 
     177Let's finally focus on the installation of mod_wsgi. 
     178 
     179Create a new file in the 'sites-available' folder of apache. It's located by default under '/etc/apache2/sites-available/'. 
     180{{{ 
     181jdoe@localhost ~$ sudo gedit /etc/apache2/sites-available/indico 
     182}}} 
     183 
     184Copy the next lines into that file, making sure to replace 'jdoe' with your username: 
     185{{{ 
     186AddDefaultCharset UTF-8 
     187<VirtualHost *:80> 
     188        # mod_wsgi indico 
     189 
     190        ErrorLog /var/log/apache2/error.log 
     191        LogLevel warn 
     192         
     193        Alias /indico/images "/home/jdoe/indico/cds-indico/indico/htdocs/images" 
     194        Alias /indico/css "/home/jdoe/indico/cds-indico/indico/htdocs/css" 
     195        Alias /indico/js "/home/jdoe/indico/cds-indico/indico/htdocs/js" 
     196        Alias /indico/ihelp "/home/jdoe/indico/cds-indico/indico/htdocs/ihelp" 
     197 
     198        WSGIDaemonProcess WSGIDAEMON processes=1 threads=1 inactivity-timeout=3600 maximum-requests=10000 \ 
     199            python-eggs=/home/jdoe/indico/tmp/egg-cache 
     200 
     201        WSGIScriptAlias /indico "/home/jdoe/indico/cds-indico/indico/htdocs/index.wsgi" 
     202         
     203        <Directory "/home/jdoe/indico/cds-indico/indico"> 
     204            WSGIProcessGroup WSGIDAEMON 
     205            WSGIApplicationGroup %{GLOBAL} 
     206            AllowOverride None 
     207            Options None 
     208            Order deny,allow 
     209            Allow from all 
     210        </Directory> 
     211</VirtualHost> 
     212}}} 
     213 
     214Here's the explanation of the above lines: 
     215 
     216    * Alias: Redirects some static locations to the containing folders, reducing load times. 
     217    * WSGIDaemonProcess: Create 5 daemon processes of 1 thread each with name WSGIDAEMON. Set the python-path and python-eggs paths. (The other two parameters are for robustness). 
     218    * WSGIScriptAlias: Redirect all petitions starting with /indico to the specified file. 
     219    * WSGIProcessGroup: Configure the execution with the settings of WSGIDAEMON. 
     220    * WSGIApplicationGroup: Set the execution to run under the same Python interpreter (the first created). 
     221 
     222 
     223Finally, enable wsgi, the new webpage and restart apache. 
     224{{{ 
     225jdoe@localhost ~$ sudo a2enmod wsgi 
     226jdoe@localhost ~$ sudo a2ensite indico 
     227jdoe@localhost ~$ sudo apache2ctl restart 
     228}}} 
     229 
     230Accessing `http://localhost/indico/index.py` should give you the main Indico page. 
     231 
     232To have a better understanding of the WSGI interface you can refer to the following document [wiki:Dev/Technical/WSGI]. 
     233If you need more informations about the installation of v0.98, the configuration of a secured protocol and so on, please refer to [wiki:Admin/Installation0.98] 
    239234 
    240235=== Edit the etc/indico.conf file. === 
     
    351346You must create a new branch for each new project, bug fixing, improvement,etc. 
    352347That branch must be created from a base one, for instance, if your contribution will 
    353 be integrated in the official branch v0.97-series, you must create the new one based 
     348be integrated in the official branch v0.98-series, you must create the new one based 
    354349on that one, like this: 
    355350 
    356351{{{ 
    357 git checkout -b new-feature-A origin/v0.97-series 
     352git checkout -b new-feature-A origin/v0.98-series 
    358353}}} 
    359354 
     
    379374=== Update your branch === 
    380375 
    381 If there are new contributions in your base branch (in our example, origin/v0.97-series) you can get them 
     376If there are new contributions in your base branch (in our example, origin/v0.98-series) you can get them 
    382377like this: 
    383378 
     
    389384 
    390385{{{ 
    391 git rebase origin/v0.97-series 
     386git rebase origin/v0.98-series 
    392387}}} 
    393388