##// END OF EJS Templates
docs: move Apache+mod_wsgi example code to the corresponding bullets...
Thomas De Schampheleire -
r7557:ee37a78c stable
parent child Browse files
Show More
@@ -499,71 +499,68 b" that, you'll need to:"
499
499
500 WSGIRestrictEmbedded On
500 WSGIRestrictEmbedded On
501
501
502 - Create a wsgi dispatch script, like the one below. Make sure you
502 - Create a WSGI dispatch script, like the one below. Make sure you
503 check that the paths correctly point to where you installed Kallithea
503 check that the paths correctly point to where you installed Kallithea
504 and its Python Virtual Environment.
504 and its Python Virtual Environment.
505 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
505
506 as in the following example. Once again, check the paths are
506 .. code-block:: python
507 correctly specified.
508
507
509 Here is a sample excerpt from an Apache Virtual Host configuration file:
508 import os
509 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
510
510
511 .. code-block:: apache
511 # sometimes it's needed to set the current dir
512 os.chdir('/srv/kallithea/')
512
513
513 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \
514 import site
514 python-home=/srv/kallithea/venv
515 site.addsitedir("/srv/kallithea/venv/lib/python2.7/site-packages")
515 WSGIProcessGroup kallithea
516 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
517 WSGIPassAuthorization On
518
516
519 Or if using a dispatcher WSGI script with proper virtualenv activation:
517 ini = '/srv/kallithea/my.ini'
518 from logging.config import fileConfig
519 fileConfig(ini)
520 from paste.deploy import loadapp
521 application = loadapp('config:' + ini)
520
522
521 .. code-block:: apache
523 Or using proper virtualenv activation:
522
524
523 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100
525 .. code-block:: python
524 WSGIProcessGroup kallithea
525 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
526 WSGIPassAuthorization On
527
526
528 Apache will by default run as a special Apache user, on Linux systems
527 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
529 usually ``www-data`` or ``apache``. If you need to have the repositories
528 execfile(activate_this, dict(__file__=activate_this))
530 directory owned by a different user, use the user and group options to
531 WSGIDaemonProcess to set the name of the user and group.
532
529
533 Example WSGI dispatch script:
530 import os
531 os.environ['HOME'] = '/srv/kallithea'
534
532
535 .. code-block:: python
533 ini = '/srv/kallithea/kallithea.ini'
536
534 from logging.config import fileConfig
537 import os
535 fileConfig(ini)
538 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
536 from paste.deploy import loadapp
537 application = loadapp('config:' + ini)
539
538
540 # sometimes it's needed to set the current dir
539 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script, as in
541 os.chdir('/srv/kallithea/')
540 the following example from an Apache Virtual Host configuration file. Once
541 again, check the paths are correctly specified.
542
542
543 import site
543 .. code-block:: apache
544 site.addsitedir("/srv/kallithea/venv/lib/python2.7/site-packages")
545
544
546 ini = '/srv/kallithea/my.ini'
545 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \
547 from logging.config import fileConfig
546 python-home=/srv/kallithea/venv
548 fileConfig(ini)
547 WSGIProcessGroup kallithea
549 from paste.deploy import loadapp
548 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
550 application = loadapp('config:' + ini)
549 WSGIPassAuthorization On
551
550
552 Or using proper virtualenv activation:
551 Or if using a dispatcher WSGI script with proper virtualenv activation:
553
552
554 .. code-block:: python
553 .. code-block:: apache
555
554
556 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
555 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100
557 execfile(activate_this, dict(__file__=activate_this))
556 WSGIProcessGroup kallithea
558
557 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
559 import os
558 WSGIPassAuthorization On
560 os.environ['HOME'] = '/srv/kallithea'
561
559
562 ini = '/srv/kallithea/kallithea.ini'
560 Apache will by default run as a special Apache user, on Linux systems
563 from logging.config import fileConfig
561 usually ``www-data`` or ``apache``. If you need to have the repositories
564 fileConfig(ini)
562 directory owned by a different user, use the user and group options to
565 from paste.deploy import loadapp
563 WSGIDaemonProcess to set the name of the user and group.
566 application = loadapp('config:' + ini)
567
564
568
565
569 Other configuration files
566 Other configuration files
General Comments 0
You need to be logged in to leave comments. Login now