##// 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 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 503 check that the paths correctly point to where you installed Kallithea
504 504 and its Python Virtual Environment.
505 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
506 as in the following example. Once again, check the paths are
507 correctly specified.
505
506 .. code-block:: python
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 python-home=/srv/kallithea/venv
515 WSGIProcessGroup kallithea
516 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
517 WSGIPassAuthorization On
514 import site
515 site.addsitedir("/srv/kallithea/venv/lib/python2.7/site-packages")
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
524 WSGIProcessGroup kallithea
525 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
526 WSGIPassAuthorization On
525 .. code-block:: python
527 526
528 Apache will by default run as a special Apache user, on Linux systems
529 usually ``www-data`` or ``apache``. If you need to have the repositories
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.
527 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
528 execfile(activate_this, dict(__file__=activate_this))
532 529
533 Example WSGI dispatch script:
530 import os
531 os.environ['HOME'] = '/srv/kallithea'
534 532
535 .. code-block:: python
536
537 import os
538 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
533 ini = '/srv/kallithea/kallithea.ini'
534 from logging.config import fileConfig
535 fileConfig(ini)
536 from paste.deploy import loadapp
537 application = loadapp('config:' + ini)
539 538
540 # sometimes it's needed to set the current dir
541 os.chdir('/srv/kallithea/')
539 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script, as in
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
544 site.addsitedir("/srv/kallithea/venv/lib/python2.7/site-packages")
543 .. code-block:: apache
545 544
546 ini = '/srv/kallithea/my.ini'
547 from logging.config import fileConfig
548 fileConfig(ini)
549 from paste.deploy import loadapp
550 application = loadapp('config:' + ini)
545 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \
546 python-home=/srv/kallithea/venv
547 WSGIProcessGroup kallithea
548 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
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'
557 execfile(activate_this, dict(__file__=activate_this))
558
559 import os
560 os.environ['HOME'] = '/srv/kallithea'
555 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100
556 WSGIProcessGroup kallithea
557 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
558 WSGIPassAuthorization On
561 559
562 ini = '/srv/kallithea/kallithea.ini'
563 from logging.config import fileConfig
564 fileConfig(ini)
565 from paste.deploy import loadapp
566 application = loadapp('config:' + ini)
560 Apache will by default run as a special Apache user, on Linux systems
561 usually ``www-data`` or ``apache``. If you need to have the repositories
562 directory owned by a different user, use the user and group options to
563 WSGIDaemonProcess to set the name of the user and group.
567 564
568 565
569 566 Other configuration files
General Comments 0
You need to be logged in to leave comments. Login now