Configure Wikipbx Mod Wsgi
Table of Contents
These instructions make the following assumptions:
- You are on Ubuntu/Debian
- You are working with a newly installed Apache2 that has not yet been configured
Verify Apache2 is working
- Go to http://localhost
- Make sure there are no errors
Modify Apache2 default Virtual Host
- cd /etc/apache2/sites-available
- vi default
Before
NameVirtualHost *
<VirtualHost *>
After
NameVirtualHost *:80
<VirtualHost *:80>
Create new Apache2 Virtual Host
- cd /etc/apache2/sites-available
- emacs wikipbx (NOTE: this will create a new file, and you can call it whatever you want)
Example file:
WSGIPythonPath /usr/src/wikipbx:/usr/src/django:/usr/src/freeswitch/libs/esl/python
<VirtualHost *:80>
ServerAdmin webmaster@wikipbx.yourserver.net
WSGIScriptAlias / /usr/src/wikipbx/wikipbx.wsgi
ServerName wikipbx.yourserver.net
ErrorLog /var/log/apache2/wikipbx.yourserver.net-error.log
CustomLog /var/log/apache2/wikipbx.yourserver.net.log common
</VirtualHost>
Notes:
- Replace yourserver.net with the domain name you plan on using.
- WSGIPythonPath is important as it allows WikiPBX to find the core code and certain libraries it needs, such as Django and the Event Socket Library (ESL) it uses to communicate with freeswitch.
- Adapt the paths in WSGIPythonPath to match your system
- If you haven't installed freeswitch yet, you will have some non-existent (invalid) paths in WSGIPythonPath. That's OK for now, but make sure to come back and edit these paths to point to the correct places
Activate new Apache2 Virtual Host
- cd /etc/apache2/sites-enabled
- ln -s ../sites-available/wikipbx .
- /etc/init.d/apache2 restart
Configure DNS or /etc/hosts file
/etc/hosts
vi /etc/hosts and add:
127.0.0.1 wikipbx.yourserver.net
dns
Talk to your DNS admin to have this domain added
Point browser to http://wikipbx.yourserver.net
At this point, you should see a 500 internal error in the browser. If you look at the error log (/var/log/apache2/wikipbx.yourserver.net-error.log), you will most likely see an error like:
ImproperlyConfigured: Error loading psycopg module: No module named psycopg
This means that there are missing dependencies that need to be installed.
Common Errors
Invalid command 'WSGIPythonPath'
If you get the error:
nvalid command 'WSGIPythonPath', perhaps misspelled or defined by a module not included in the server configuration
Apache is not loading the mod_wsgi module. See Install Mod Wgi
page_revision: 9, last_edited: 1261514051|%e %b %Y, %H:%M %Z (%O ago)





