Hello everyone.
I want to set up a local web-server: Apache 22 + mod_wsgi + Python 3.2
I install:
www/apache22
lang/python32
www/mod_wsgi
Add in /etc/rc.conf:
Add in /boot/loader.conf:
And configure it:
1. In /usr/local/etc/apache22/httpd.conf
1.1. I comment on:
1.2. Check availability:
1.3. Load my config (add in end file):
2. I create all project:
And
3. Write in /etc/hosts
4. Restart web-server:
Result:
================================================================================================
You use Python 2.7 version.
================================================================================================
I guess that is installed incorrectly mod_wsgi.
I remove mod_wsgi. And write in /etc/make.conf
or
and or
I found the exact version running Python:
And install www/mod_wsgi again.
But I have many ERROR!
I want to set up a local web-server: Apache 22 + mod_wsgi + Python 3.2
I install:
www/apache22
lang/python32
www/mod_wsgi
Add in /etc/rc.conf:
Code:
apache22_enable="YES"
apache22_http_accept_enable="YES"
Add in /boot/loader.conf:
Code:
accf_http_load="YES"
Code:
# kldload accf_http
# rehash
And configure it:
1. In /usr/local/etc/apache22/httpd.conf
1.1. I comment on:
Code:
...
# LoadModule unique_id_module libexec/apache22/mod_unique_id.so
...
Code:
...
LoadModule wsgi_module libexec/apache22/mod_wsgi.so
...
Code:
...
NameVirtualHost 127.0.0.1:80
Include /usr/local/www/siboo/siboo.conf
2. I create all project:
Code:
# mkdir -p /usr/local/www/siboo/
# cd /usr/local/www/siboo/
# cat siboo.conf
<VirtualHost siboo:80>
ServerName siboo
DocumentRoot "/usr/local/www/siboo"
DirectoryIndex index.html index.htm
WSGIScriptAlias / /usr/local/www/siboo/application.wsgi
<Directory /usr/local/www/siboo>
Options All
Options MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog /usr/local/www/siboo/error.log
CustomLog /usr/local/www/siboo/access.log common
</VirtualHost>
And
Code:
# cat application.wsgi
import sys
def app(environ, start_response):
" ... "
message = "You use Python %s version." % sys.version[:3]
start_response("200 OK", [("Content-Type", "text/html")])
return [message]
application = app
Code:
...
127.0.0.1 siboo siboo.my.domain
4. Restart web-server:
Code:
# /usr/local/etc/rc.d/apache22 restart
# w3m siboo
================================================================================================
You use Python 2.7 version.
================================================================================================
I guess that is installed incorrectly mod_wsgi.
I remove mod_wsgi. And write in /etc/make.conf
Code:
...
PYTHON_VERSION=3.2.1
PYTHON_DEFAULT_VERSION=3.2.1
Code:
...
#PYTHON_VERSION=3.2.1
PYTHON_DEFAULT_VERSION=3.2
Code:
...
#PYTHON_VERSION=3.2.1
PYTHON_DEFAULT_VERSION=python3.2
Code:
# python3.2
Python 3.2.1 (defult, Sep 2 2011, 18:43:12)
...
Code:
# rehash
But I have many ERROR!