DevReview.net

More development notices …

Archive for the ‘Hello World’ tag

Config apache mod_wsgi for python web applications

leave a comment

Installing mod_wsgi
Example of http.conf:
LoadModule wsgi_module        libexec/apache22/mod_wsgi.so

Example


ServerName python.dev
ServerAdmin webmaster@python.dev
DocumentRoot "/usr/local/www/apache22/data/sites/python.dev"


Order allow,deny
Allow from all

WSGIScriptAlias / /usr/local/www/apache22/data/sites/python.dev/index.py

ErrorLog "/var/log/python.dev-error_log"
CustomLog "/var/log/python.dev-access_log" common

Example of index.py

def application(environ, start_response):
status = '200 OK'
output = 'Hee ello 34 World!'

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

return [output]

restart apache & check http://python.dev

Written by admin

May 29th, 2011 at 1:29 pm

Posted in python

Tagged with , , ,

Install Apache Tomcat & Hello World via Java Servlets and JSP

leave a comment

First of all, you need java, how to install jdk on FreeBSD check here: How to install JAVA on FreeBSD
How to install Apache Tomcat on FreeBSD & test how it works:

installation:
/usr/ports/www/tomcat6
make install clean

run webserver:
cd /usr/local/apache-tomcat6.0/bin
./startup.sh

Read the rest of this entry »

Written by admin

March 17th, 2010 at 11:15 am