存档

2009年8月 的存档

oracle不同版本对jdbc3.0的支持情况

2009年8月19日 评论已被关闭

Which JDBC drivers support which versions of JDBC?
Oracle 9.0.1 supports:
    * JDBC 2.0 Extensions except for: using both global and local transactions on the same connection.

Oracle 9.2.0 supports:
    * Partial support for JDBC 3.0: transaction savepoints
    * using both global and local transactions on the same connection.

Oracle 10.1.0 supports:
    * Full support for JDBC 3.0 except for: retrieving auto-generated keys
    * result-set holdability
    * returning multiple result-sets.

Oracle 10.2.0 supports:
      Full support for JDBC 3.0
    * Note that there is no real change in the support for the following in the database. All that has changed is that some methods that previously threw SQLException now do something more reasonable instead. result-set holdability
    * returning multiple result-sets.

Oracle 11.1.0 supports:
      Full support for JDBC 3.0 in the JDK 1.5 drivers.
      Full support for JDBC 4.0 in the JDK 1.6 drivers with the exception of SQLXML which is not supported

详细见:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#02_04

分类: database 标签:

nginx+Django+memchached环境搭建备忘

2009年8月14日 评论已被关闭

系统环境
Kernal:Linux 2.6.9-78
nginx-0.7.61
pcre-7.9
Python version: 2.5.4
Django-1.1-py2.5
mysql-5.0.84
flup-1.0.2-py2.5
MySQL_python-1.2.3c1-py2.5-linux-i686
python_memcached-1.44-py2.5
setuptools-0.6c9-py2.5

1、nginx、python、mysql的安装可参考官方及网上的安装文档

2、安装django  http://www.djangoproject.com/
wget http://media.djangoproject.com/releases/1.1/Django-1.1.tar.gz
tar zxvf Django-1.1.tar.gz
cd Django-1.1
python setup.py install

3、Django以fastcgi方式启动需要
python-flup
wget http://www.saddi.com/software/flup/dist/flup-1.0.2.tar.gz
tar zxvf flup-1.0.2.tar.gz
cd flup-1.0.2
python setup.py install

4、MySQL-python-1.2.3c1.tar.gz
下载地址: http://sourceforge.net/projects/mysql-python/files/

我在安装和配置中遇到的问题:
1、mysql数据库连接:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory
我曾经装过了mysql5.2,发现MYSQL_HOME/lib中没有libmysqlclient_r.so.15,倒是有libmysqlclient_r.so.16,可能是因为mysql版本比较高的缘故,或者是因为dj版本比较低??
所以我选择了mysql5.0
tar MySQL-python-1.2.3c1.tar.gz
cd MySQL-python-1.2.3c1
python setup.py build

会有如下报错:
_mysql.c:2516: error: `v’ undeclared (first use in this function)
_mysql.c:2527: error: `name’ undeclared (first use in this function)
_mysql.c:2528: error: `self’ undeclared (first use in this function)
error: command ‘gcc’ failed with exit status 1
解决办法是:
vi site.cfg
# The path to mysql_config.
# Only use this if mysql_config is not on your PATH, or you have some weird
# setup that requires it.
mysql_config = /home/2hei.net/mysql/bin/mysql_config
然后接续
python setup.py build
python setup.py install

2、实际中还有这个错误出现:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /lib/tls/libc.so.6: version `GLIBC_2.4′ not found (required by /home/yujingtao/.python-eggs/MySQL_python-1.2.3c1-py2.5-linux-i686.egg-tmp/_mysql.so
解决办法是:
vi /etc/ld.so.conf
add /home/2hei.net/mysql/lib
#ldconfig /etc/ld.so.conf

3、新建立一个Django的webapp
django-admin.py startproject myweb

4、Django的启动
#django作为独立启动
django manage.py runserver method=threaded 127.0.0.1:8080

#以FastCGI方式启动
python manage.py runfcgi method=threaded host=127.0.0.1 port=9000
因为我的Django是跟nginx配合使用的,所以普通用户在内网监听大于1024的端口即可
因为每次更改urls.py都需要重启一下fastcg,为了方便使用我写了一个脚本:

#!/bin/bash
#script-name: start_myweb.sh
#wirte by: 2hei at 2009/08/12
cd /home/2hei/djproject/
if [ $# -lt 1 ];then
echo “Usages: sh start_myweb.sh [start|stop|restart]”
exit 0
fi
if [ $1 = start ];then
  isrun=`ps aux|grep “manage.py runfcgi”|grep -v “grep”|wc -l`
  if [ $isrun -eq 1 ];then
    echo “dj has running!”
    exit 0
  else
    /home/python/bin/python myweb/manage.py runfcgi method=threaded host=127.0.0.1 port=9000 –settings=settings
  fi
elif [ $1 = stop ];then
  djid=`ps aux|grep “manage.py runfcgi”|grep -v “grep”|awk ‘{print $2}’`
  kill -9 $djid
elif [ $1 = restart ];then
  djid=`ps aux|grep “manage.py runfcgi”|grep -v “grep”|awk ‘{print $2}’`
  kill -9 $djid
  /home/python/bin/python myweb/manage.py runfcgi method=threaded host=127.0.0.1 port=9000 –settings=settings
else
  echo “Usages: sh start_myweb.sh [start|stop|restart]”
fi

5、关于nginx解析Django静态文件的处理
nginx.conf

        location /media/ {
                root /home/2hei.net/djproject/myweb;
                break;
        }

cp -r /home/python/lib/python2.5/site-packages/django/contrib/admin/media/ /home/2hei.net/djproject/myweb/
Django管理界面:
dj-admin.JPG

6、因为需要用到memcache,所以memcach与Django进行了结合:
urls.py
urlpatterns = patterns(”,
    (r’^admin/’, include(admin.site.urls)),
    (r’^status/cache/$’, ‘myweb.memcached_status.view’),

settings.py
CACHE_BACKEND = ‘memcached://127.0.0.1:11211/’

dj-memcache.JPG

—————end——————-

分类: others 标签: ,

nginx 的debug模式

2009年8月9日 评论已被关闭

编译的时候添加:

–with-debug

 nginx.conf中的配置:

error_log  logs/error.log debug;

#master_process  off;
daemon          off;
daemon off;            

说明:
master_process  on; 
Do not use the “daemon” and “master_process” directives in a production mode, these options are mainly used for development only. You can use  daemon off  safely in production mode with runit / daemontools however you can’t do a graceful upgrade.  master_process off  should never be used in production.

生产环境中不要使用”daemon”和”master_process”指令,这些选项仅用于开发调试。

分类: OpenSource 标签:

Your intltool is too old. You need intltool 0.35.0 or later

2009年8月5日 评论已被关闭

编译rrdtool时,提示这样的错误:
checking for intltool >= 0.35.0… 0.31.2 found
configure: error: Your intltool is too old.  You need intltool 0.35.0 or later.

解决办法如下:
wget http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.gz
tar zxvf intltool-0.40.6.tar.gz
cd intltool-0.40.6
./configure
make && make install

编译之后有个地方比较搞笑,原来作者也挺有幽默感的哦!
SOLARIS HINT: if you want to build the Perl module for the native Perl (the one shipping with Solaris) you will need the Sun Forte compiler installed on your box or you have to hand-tune bindings/perl-shared/Makefile while building!

Now go to $INSTALL_DIR/share/rrdtool/examples/ and run them to see if your build has been successful.

checking in… and out again
ordering CD from http://tobi.oetiker.ch/wish …. just kidding 😉
Config is DONE!

          With MMAP IO: yes
      Build rrd_getopt: no
       Static programs: no
          Perl Modules: perl_piped perl_shared
           Perl Binary: /usr/bin/perl
          Perl Version: 5.8.5
          Perl Options: PREFIX=$(DESTDIR)/usr/local/rrdtool-1.3.8 LIB=$(DESTDIR)/usr/local/rrdtool-1.3.8/lib/perl/5.8.5
          Ruby Modules:
           Ruby Binary: no
          Ruby Options: sitedir=$(DESTDIR)/usr/local/rrdtool-1.3.8/lib/ruby
    Build Tcl Bindings: no
 Build Python Bindings: yes
          Build rrdcgi: yes
       Build librrd MT: yes
     Link with libintl: yes

             Libraries: -lxml2 -lcairo -lcairo -lcairo -lm  -lcairo -lfreetype -lz -lfontconfig -lpng12 -lpixman-1   -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lfreetype -lz -lfontconfig -lpng12 -lpixman-1 

Type ‘make’ to compile the software and use ‘make install’ to
install everything to: /usr/local/rrdtool-1.3.8.

       … that wishlist is NO JOKE. If you find RRDtool useful
make me happy. Go to http://tobi.oetiker.ch/wish and
place an order.

分类: OpenSource 标签: