Skip to content

Instantly share code, notes, and snippets.

@noodles-v6
Created September 18, 2012 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noodles-v6/3741527 to your computer and use it in GitHub Desktop.
Save noodles-v6/3741527 to your computer and use it in GitHub Desktop.
apache2/mod_python/mysql/django install on suse 11
/etc/init.d/apache2 restart
/etc/init.d/mysql start
/etc/init.d/apache2 restart
/etc/init.d/mysql restart
开机自启动
========
在/etc/rc.d/rc.local 中添加
#apache2
/etc/init.d/apache2 start
#mysql
/etc/init.d/mysql start
mysql字符集配置
===============
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
default-character-set = utf8
collation_server = utf8_unicode_ci
init_connect='SET NAMES utf8'
character_set_server = utf8
GRANT ALL PRIVILEGES ON *.* TO 'econf'@'localhost' IDENTIFIED BY 'econf';
CREATE DATABASE site DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE backup DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use mysql
delete from user where user='econf';
flush privileges ;
show variables like 'character%';
ALTER DATABASE econf DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql --default-character-set=utf8 -u econf -peconf site < mysql.20120926.bak;
suse11 下搭建django环境
---------------------
SUSE11下是默认安装apache2的,mod_python模块也在安装包中,若未安装则通过zypper安装就行,生成的so在:/usr/lib64/apache2/mod_python.so
mysite.conf
==========
在/etc/apache2/conf.d下添加mysite.conf文件,编辑如下
LoadModule python_module /usr/lib64/apache2/mod_python.so
<VirtualHost 10.166.104.56:80>
ServerName econf.org
DocumentRoot /home/eConfer/www
<Directory /home/eConfer/www>
Options Indexes Multiviews
AllowOverride None
Order Allow,Deny
#Allow from 10.11.0.78
Allow from all
</Directory>
Alias /econf/manage /home/eConfer/www/beta
<Directory /home/eConfer/www/beta>
SetHandler python-program
PythonPath "['/home/eConfer/www/beta'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE beta.settings
PythonDebug On
</Directory>
#Alias /media /srv/www/Media
#
# <Directory /srv/www/Media>
# SetHandler None
# </Directory>
Alias /static /home/eConfer/www/beta/static
<Directory /home/eConfer/www/beta/static>
SetHandler None
</Directory>
</VirtualHost>
mysql
=====
创建用户
GRANT ALL PRIVILEGES ON *.* TO 'econf'@'localhost' IDENTIFIED BY 'econf' WITH GRANT OPTION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment