在亚马逊EC2上部署Apache和Django

EC2是亚马逊(Amazon.com)提供的弹性云计算服务; Apache是一个跨平台的Web服务器端软件,可以使Python、PHP、Perl等语言编写的程序运行在服务器上; Django是一个Web程序框架,应用这个框架,可以使Python Web程序的编写变得更加简单; Amazon S3是亚马逊提供的云存储服务; Amazon EC2与Amazon S3结合, 几乎可以提供无限的存储空间和无限的计算能力。

以上这些东西综合在一起,就可以用简单易用的Python做出一个提供海量数据处理功能的网站,感觉这玩意儿应该在高通量测序数据数据处理方面有点用。

下面是在亚马逊EC2上部署Apache和Django的步骤:

0. 首先需要AWS上在建立一个EC2 Instance,使用Ubuntu Linux系统,可以直接在Community AMI中直接选择Ubuntu官方的AMI,ID为ami-cef405a7,EC2 Instance的建立过程并不复杂,这里就不细说了。注意:建好之后用SSH登录的时候,用户名是ubuntu,不是ec2-user,也不是 root.

1. 安装apache sudo apt-get install apache2

2. 下载安装Django wget http://www.djangoproject.com/download/1.3/tarball/ 下载下来的文件名是index.html,改一下名 mv index.html Django-1.3.tar.gz 解压 tar xzvf Django-1.3.tar.gz 安装 cd Django-0.91 sudo python setup.py install

3. 安装 mod_python apt-get install libapache2-mod-python

4. 重启Apache /etc/init.d/apache2 start

5. […]

linux 增加虚拟内存

mkdir /swaps dd if=/dev/zero of=/swapfile bs=1024 count=20480000 ##20G

mkswap /swaps/1.swap swapon /swaps/1.swap # check state swapon -s

# turn off swapoff # set auto boot

# 随机启动:添加一行到/etc/fstab /swaps/1.swap none swap sw 0 0

网站版权copyright后面的符号输出显示

copyright是著作版权声明,一般出现在网站底部。 示例:Copyright © 1998 表示:在1998所有拷贝权(也就是使用权),所有的权利都给所有者使用。当然,著作版权声明还有好多其他的写法,你可以在网络上搜索到相关示例,这里就不啰嗦了。 但是Copyright © 1998 后面这个圈C的标记符号很多站长输入到网页中却无法输出显示出来,不是不识别,就是变成小点。 怎么办呢?问题的核心主要是这个圈C的符号字体编码设置不当,这里提供了几种copyright后面符号输出显示的方法: (1)DW中,插入-特殊符号-版权即可;</P> (2)或者直接在源代码中输入” &copy “; (3)在PS里,制作效果图的时候,会显示成小一点的,在网页中,如果字体为12PX的话,会显示正常的; (4)这是font-family的设置问题…只要把那些个字的font-family设为Arial, Helvetica, sans-serif就可以了

【转】PBS环境qsub, qstat, qdel(1)

PBS 是公开源代码的作业管理系统,在此环境下运行,用户不需要指定程序在哪些节点上运行,程序 所需的硬件资源由PBS 管理和分配。 1、PBS 命令 PBS 提供4 条命令用于作业管理。 (1) qsub 命令—用于提交作业脚本 命令格式: qsub [-a date_time] [-c interval] [-C directive_prefix] [-e path] [-I] [-j join] [-k keep] [-l resource_list] [-m mail_options] [-M user_list][-N name] [-o path] [-p priority] [-q destination] [-r c] [-S path_list] [-u user_list][-v variable_list] [-V] [-W additional_attributes] [-z] [script] 参数说明:因为所采用的选项一般放在pbs 脚本中提交,所以具体见PBS 脚本选项。 […]

High CPU/RAM usage and Parallel(MPI) jobs submitted sample scripts

for Single CPU Job

zyshen@e2lx001:/home/zyshen> cat /disk/rdisk03/test_1cpu.sh #!/bin/csh # # #PBS -l nodes=1:ppn=1 # #******** Script for job submission with single CPU #******** The lines above must be included in any job script #******** ‘nodes’ is number of nodes and ‘ppn’ is number of CPU per node, which are both ‘=1′ in this case. # […]

ubuntu 9.10 下安装glimmer3失败及其解决办法

(1)安装前,先修改src/Common下第26行#include <string> 为 #include <cstring>;再make,可是仍然会产生以下错误 * Make Target is all ##### Making Directory /usr/local/glimmer3.02/src/Common all ##### make[1]: 正在进入目录 `/usr/local/glimmer3.02/src/Common’ @@@@@@@@@@@@@@@@@@@ delcher.cc @@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@ fasta.cc @@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@ gene.cc @@@@@@@@@@@@@@@@@@@@@ gene.cc: In member function ‘void PWM_t::Print(FILE*)’: gene.cc:263: warning: deprecated conversion from string constant to ‘char*’ gene.cc: In function ‘int Char_Sub(char)’: gene.cc:448: error: invalid conversion from ‘const char*’ […]

INSTALL MicrobeDB

shenzy@shenzy-ubuntu:/usr/local/lib/perl/5.10.1/MicrobeDB/scripts$ load_genome.pl -d /home/shenzy/Downloads/unpublished_genomes/Pseudomonas_aeruginosa_LESB58/ 2012/05/15 16:01:48> Working on /home/shenzy/Downloads/unpublished_genomes/Pseudomonas_aeruginosa_LESB58/ 2012/05/15 16:01:48> Parsing file: /home/shenzy/Downloads/unpublished_genomes/Pseudomonas_aeruginosa_LESB58/Pseudomonas_aeruginoas_LESB58.gbk 2012/05/15 16:01:48> Can’t find file:/home/shenzy/Downloads/unpublished_genomes/NCBI_completegenomes.txt . GenomeProject table will not contain much organism information. 2012/05/15 16:01:48> Can’t find file:/home/shenzy/Downloads/unpublished_genomes/NCBI_completegenomes.txt . GenomeProject table will be missing a few fields of information. DBD::mysql::st execute failed: Unknown column ‘distance_calculated’ in ‘field list’ at […]

EnvironmentError: mysql_config not found

EnvironmentError: mysql_config not found

MySQL for Python library在Python中也就相当于JAVA中对应MySQL的JDBC Driver

1. 首先安装mysql

sudo apt-get install mysql-server

 

2. 安装mysql-python

下载MySQL-python-1.2.3.tar.gz(见附件),解压到指定目录。

到解压后的MySQL-python-1.2.3目录下编译配置MySQL-python:

python setup.py build

此时系统报错:EnvironmentError: mysql_config not found

很明显没有mysql_config这个文件

执行find / -name mysql_config,没有任何数据,表明系统中没有mysql_config这个文件

 

 

网上有人解释说使用apt-get安装的MySQL是没有mysql_config这个文件的

解决办法:sudo apt-get install libmysqld-dev

 

此时执行 find / -name mysql_config 在/usr/bin/下发现了这个文件

然后修改MySQL-python-1.2.3目录下的site.cfg文件

去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准)

执行下面命令,此时可以成功编译安装了:

python setup.py build

python setup.py install

[…]

Apache2 won’t load index.php files

I have also noticed that apache won’t even load HTML files from the root (/var/www) directory. As far as I can see. Apache won’t load any page from the root directory. For example when I give to my browser http://localhost/ firefox will display me a dialog asking me to SAVE a PHTML file.

It seems […]

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

/etc/init.d/mysqld stop mysqld_safe –skip-grant-tables & mysql -u root mysql> use mysql; mysql> update user set password=PASSWORD(“newrootpassword”) where User=’root'; mysql> flush privileges; mysql> quit /etc/init.d/mysqld stop /etc/init.d/mysqld start