Created
October 27, 2013 20:31
-
-
Save MaxMorais/7187526 to your computer and use it in GitHub Desktop.
2 ways to setup ERPNext with Apache and WSGI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Listen 8080 | |
NameVirtualHost *:8080 | |
<VirtualHosst *:8080> | |
ServerName localhost | |
# you ERPNext folder | |
DocumentRoot /var/www/erpnext/public | |
AddHandler cgi-script .cgi .xml .py | |
AddType application/vnd.ms-fontobject .eot | |
AddType font/ttf .ttf | |
AddType font/otf .otf | |
AddType application/x-font-woff .woff | |
<Directory /var/www/erpnext/public/> | |
# directory specific options | |
Options -Indexes +FollowSymLinks +ExecCGI | |
# directory's index file | |
DirectoryIndex CGIHandler.py | |
AllowOverride all | |
Order Allow,Deny | |
Allow from all | |
# rewrite rule | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-l | |
RewriteRule ^([^/]+)$ CGIHandler.py?page=$1 [QSA,L] | |
</Directory> | |
</VirtualHost> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Listen 8080 | |
NameVirtualHost *:8080 | |
<VirtualHosst *:8080> | |
ServerName localhost | |
# you ERPNext folder | |
DocumentRoot /var/www/erpnext/public | |
AddType application/vnd.ms-fontobject .eot | |
AddType font/ttf .ttf | |
AddType font/otf .otf | |
AddType application/x-font-woff .woff | |
WSGIDaemonProcess erpnext user=erṕnext group=erpnexy threads=5 | |
WSGIScriptAlias / /var/www/erpnext/public/WSGIHandler.wsgi | |
<Directory /var/www/erpnext/public/> | |
WSGIProcessGroup yourapplication | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow | |
Allow from all | |
</Directory> | |
</VirtualHost> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, os | |
sys.path.append(os.path.abspath( | |
os.path.join( | |
os.path.dirname(__file__), | |
'..' | |
) | |
) | |
) | |
from wsgiref import CGIHandler | |
from lib.webnotes.app import application | |
if __name__ == '__main__': | |
CGIHandler().run(application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, os | |
sys.path.append(os.path.abspath( | |
os.path.join( | |
os.path.dirname(__file__), | |
'..' | |
) | |
) | |
) | |
from lib.webnotes.app import application | |
if __name__ == '__main__': | |
application.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment