python: web2py apache-gaz imiñi martxan debian gnu/linux-en mod-wsgi bidez

web2py python-en framework bat da web aplikaziñuek python-egaz eitzeko, instalateko hau script-e prepara dot, kanbije usuaidxue, grupue eta proiektuen karpetie zeuon gustora:

1go gauzie root moduen konekta eta script-e sortu:

su
nano web2py_install.sh
#!/bin/bash
user='zital'
group=$user
project_path='/home/projects'
current_path=`echo $PWD`

me=`whoami`

if [ "$me" == "root" ]
then
	aptitude -y install libapache2-mod-wsgi unzip wget
	cd ${project_path}
	wget http://web2py.com/examples/static/web2py_src.zip
	unzip web2py_src.zip
	rm -rf web2py_src.zip
	chown -R ${user}:${group} ${project_path}/web2py
	cd ${current_path}
else
	echo "please log with root user"

fi
exit

oin permisuek emon eta ejekute:

chmod +x web2py_install.sh
./web2py_install.sh

Oin apache konfigureku, lelau:
/etc/apache2/apache2.conf artxibuen topa hau:

Include ports.conf

eta komenta:

#Include ports.conf

Oin sortu web2py-ntzako artxibue:

nano /etc/apache2/sites-available/web2py
Listen 80
NameVirtualHost *:80


	WSGIDaemonProcess web2py user=zital group=zital display-name=%{GROUP}
	WSGIProcessGroup web2py
	WSGIScriptAlias / /home/projects/web2py/wsgihandler.py

	
		AllowOverride None
		Order Allow,Deny
		Deny from all
		
			Allow from all
		
	

	AliasMatch ^/([^/]+)/static/(.*) \
		/home/projects/web2py/applications/$1/static/$2
	
		Order Allow,Deny
		Allow from all
	

	
		Deny from all
	

	
		Deny from all
	

	CustomLog /var/log/apache2/web2py-access.log common
	ErrorLog /var/log/apache2/web2py-error.log

okin kontutan usuaidxue eta grupue aldatu behar’zuiela zeuon gustora, oin lekue aktibe eta apache reinizie:

a2dissite default
a2dissite default-ssl
a2ensite we2bpy
/etc/init.d/apache restart

Oin nabegadoran: http://localhost

eskerrak: http://www.web2pyslices.com/main/slices/take_slice/29

Utzi erantzuna

Zure e-posta helbidea ez da argitaratuko. Beharrezko eremuak * markatuta daude