Showing posts with label apache2. Show all posts
Showing posts with label apache2. Show all posts

Monday, June 25, 2012

Set up Apache2 for SSL

For site "foo"

/etc/apache2/sites-enabled/default-ssl

        SSLEngine on
        SSLCertificateFile    /etc/ssl/foo/foo.crt
        SSLCertificateKeyFile /etc/ssl/foo/foo.key
       SSLCertificateChainFile /etc/ssl/foo/intermediate.pem



get the intermediate certificate: https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=SO1498

Wednesday, April 18, 2012

Install and Configure mod_jk for Apache2


  • sudo apt-get install libapache2-mod-jk
  • sudo vim /etc/libapache2-mod-jk/workers.properties
    • worker.list=worker1,jk-status
    • worker.jk-status.type=status
  • sudo vim /etc/apache2/mods-available/jk.conf  
  • #Everything under root goes to tomcat
    • JkMount  /share/* worker1
    • JkMount  /share worker1

Thursday, January 14, 2010

How to build mod_wsgi,web.py with httpd and python from source code

It is best to compile everything from source code.

Version used
Python: 2.7 (with shared library)httpd 2.2.17 (with shared DSO support)WSGI (integrating with httpd): mod_wsgi 3.3
Web framework: web.py 0.34

Compile Python for shared lib

./configure --prefix= --enable-shared


Set up LD_LIBRARY_PATH so that running "python" would find its shared lib
export LD_LIBRARY_PATH=${python-lib}:$LD_LIBRARY_PATH


Compile (apache) httpd Add DSO support
./configure --prefix= --enable--module=module_so



Compile mod_wsgi
./configure --with-apxs=$APACHE_HOME/bin/apxs --with-python=$PYTHON_BIN/python

Configure httpd.conf for mod_wsgi



LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /wsgi/ /u/local/www/wsgi-scripts/

WSGIApplicationGroup admin-scripts
Order allow,deny
Allow from all

WSGIProcessGroup example1.com
WSGIDaemonProcess example1.com processes=2 threads=15 display-name=example1.com

Install a sample python code under /u/local/www/wsgi-scripts/sniff
import sys
def application(environ, start_response):
status = '200 OK'
output = 'sys.version= %s\nsys.prefix=%s\n' % (sys.version, sys.prefix)
output += 'sys.path= %s\n' % (sys.path)

response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output]