1. 免密码登陆

# 本机生成密钥, 并将 pub 复制到阿里云服务器上
$ ssh-keygen -t rsa -P '' # -P表示密码,-P '' 就表示空密码
$ scp ~/.ssh/FILENAME.pub root@server_ip:/root # 阿里云服务器上将 pub 放入 authorized_keys 中
# cat FILENAME.pub >> ~/.ssh/authorized_keys
# chmod 600 ~/.ssh/authorized_keys

2. yum

默认的环境并不 OK.

1) 运行出错提示    No module named yum

解决方案: #vi /usr/bin/yum 将 #!/usr/bin/python 修改为  #!/usr/bin/python2.4

2) 下载yum的配置源

mkdir /etc/yum.repos.d/
cd /etc/yum.repos.d/
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

3) 运行yum makecache生成缓存

若重新安装 yum

查看yum包  rpm -qa|grep yum 
卸载  rpm -qa|grep yum|xargs rpm -e --nodeps 
安装:

1) 下载安装所需的三个文件, 下载地址: http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/

yum-3.2.-.el5.centos.noarch.rpm
yum-fastestmirror-1.1.-.el5.centos.noarch.rpm
yum-metadata-parser-1.1.-.el5.x86_64.rpm

2)  安装命令

rpm -ivh yum-*

注意:yum和yum-fastestmirror相互依赖,所以需要同时安装。

3) 恢复 /etc/yum.conf 文件, 一般卸载时会自动备份.

3. 开发环境依赖包更新

$ yum update
$ yum -y install gcc g++ autoconf
$ yum -y install openssl openssl-devel zlib zlib-devel

4. python

手动编译安装 Python, 官网下载源码即可.

./configure  --enable-shared  # if not, error -- libpython2..a:  could not read symbols: Bad value
make
make install

此时运行 python 可能报错:

python: error while loading shared  libraries: libpython2.7.so.1.0:

cannot open shared object file: No such file or

解决方案:

$ vim /etc/ld.so.conf.d/python2..conf
# 加入内容:
/usr/local/lib #保存退出后运行:
$ ldconfig

pip 与 库. 源码 setup.py 安装 setuptools 与 pip

yum install -y  python-setuptools python-devel
sudo easy_install -U distribute

5. 手动安装 git

http://distfiles.macports.org/git/ 下载最新 git
$ yum install gettext-devel

$ wget http://distfiles.macports.org/git/git-2.1.1.tar.gz
$ tar zxvf git-2.1..tar.gz
$ cd git-2.1.
$ autoconf
$ ./configure
$ make
$ make install

6. MySQL

# rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm  # 导入第三方源webtatic
# yum remove mysql mysql-*
# yum install libmysqlclient15 --enablerepo=webtatic
# yum install mysql55 mysql55-server --enablerepo=webtatic
# service mysqld start

安全性配置

# mysql_secure_installation  # secure settings

字符编码设置:

http://www.cnblogs.com/misspy/p/4033352.html

开机自动启动

# chkconfig --levels  mysqld on
# service mysqld restart

7. apache2 与 mod_wsgi

# yum install httpd httpd-devel

# chkconfig --levels  httpd on
# service httpd restart

源码安装 mod_wsgi https://github.com/GrahamDumpleton/mod_wsgi

配置

WSGIScriptAlias / /var/www/django_server/wsgi.py

<Directory "/var/www/django_server/static/">
Order deny,allow
Allow from all
</Directory> <Directory "/var/www/django_server/">
AllowOverride All
Order deny,allow
Allow from all
</Directory> <Location "/media/">
SetHandler None
</Location> <LocationMatch "\.(jpg|gif|png)$">
SetHandler None
</LocationMatch> Alias /static/admin/ /usr/local/lib/python2./site-packages/django/contrib/admin/static/admin/
Alias /static/ /var/www/django_server/static/

阿里云 centos 环境配置与 django 部署的更多相关文章

  1. 阿里云ecs环境配置

    在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境 https://ninghao.net/blog/1368 阿里云ecs从购买到环境搭建和建站!! ...

  2. 阿里云CentOS环境下tomcat启动超级慢的解决方案

    1 为什么会出现这个问题 Tomcat在本地服务器跑,一切都正常,但部署到阿里云上,发现启动巨慢. 经过在网上搜索,找到了原因: Tomcat 7/8都使用org.apache.catalina.ut ...

  3. 阿里云 centOS系统 配置 node + ngnix

    **centOS系统可以直接使用yun命令** 安装node 1.使用git将源码克隆到本地的~/.nvm目录下,并检查最新版本.> yum install git > git clone ...

  4. 阿里云CentOS安装配置Python3.7及pip3

    一.安装Python3.7 安装依赖包 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqli ...

  5. 阿里云+LAMP环境配置

    1. 准备好一键Linux环境的脚本: http://dwz.cn/6Nlexm 2. 运行命令:# yum install lynx tree nmap sysstat lrzsz dos2unix ...

  6. 阿里云centos postgresql9.4源码安装 精简步骤、问题解答

    阿里云centos环境源码安装postgresql9.4 本文的安装步骤主要来源于http://www.cnblogs.com/mchina/archive/2012/06/06/2539003.ht ...

  7. 在阿里云服务器上配置CentOS+Nginx+Python+Flask环境

    在阿里云服务器上配置CentOS+Nginx+Python+Flask环境 项目运行环境 阿里云(单核CPU, 1G内存, Ubuntu 14.04 x64 带宽1Mbps), 具体购买和ssh连接阿 ...

  8. 阿里云centos 安装和配置 DokuWiki

    安装 1) 添加虚拟主机:由于我的 阿里云CentOs服务器 安装了oneinstack的一键部署PHP.JAVA.Nginx等环境,所以域名配置很方便,照着文档一步一步做就可以了 cd /root/ ...

  9. 阿里云ECS 环境是CentOS 7.3安装mongodb3

    CentOS安装mongodb https://www.cnblogs.com/zddzz/p/10069912.html CentOS安装mongodb 我的是阿里云ECS 环境是CentOS 7. ...

随机推荐

  1. JNI 系统钩子

    占个位置,日后学会了补充: JAVA是运行在虚拟机上的,而钩子函数是直接对操作系统进行操作控制的,这也是Java和C的主要区别之一,Java要实现钩子函数比较麻烦,需要使用JNI技术,就是Java本地 ...

  2. iOS开发——网络编程Swift篇&(五)同步Post方式

    同步Post方式 // MARK: - 同步Post方式 func synchronousPost() { //创建NSURL对象 var url:NSURL! = NSURL(string: &qu ...

  3. sysbench 安装 原创

    1.下载sysbench version 0.5 https://github.com/akopytov/sysbench 2. [root@server1 sysbench-0.5]# pwd/ro ...

  4. android:layout_weight总有你不知道的用法.

    都知道weight是权重的意思. 在布局中起到非常重要的作用. 但是这玩意不能嵌套使用, 而且只能使用在LinearLayout中. 下面说说它的几种用法(以下例子全为横排 注意android:lay ...

  5. HDU--杭电--1195--Open the Lock--深搜

    Open the Lock Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  6. http协议Authorization认证方式在Android开发中的使用

    我们都知道,http协议是一种无状态协议,在Web开发中,由于Session和Cookie的使用,使得服务端可以知道客户端的连接状态,即用户只需要在浏览器上登录一次,只要浏览器没有关闭,后续所有的请求 ...

  7. CCOrbitCamera卡牌翻转效果

    static CCOrbitCamera* create(float t, float radius, float deltaRadius, float angleZ, float deltaAngl ...

  8. MPMoviePlayerController过期导致视频播放时间条颠倒及AVPlayerViewController的用法

    MPMoviePlayerController虽然好用 但是过期了 所以可能会导致一些莫名的问题  ,比如说下面时间条的问题 但我们可以使用AVPlayerViewController来实现相应的想过 ...

  9. OPENSSL安装 以及使用openssl中的AES加密和解密

    OPENSSL安装:(VS) 1:第一步和所有的软件安装一样. 2:将OPENSSL中INLUCDE 和 LIB 分别拷贝到VS中VC的INLUCDE 和LIB目录下(我的机器上的目录是:C:\Pro ...

  10. python(1) - 第一个程序 Hello World!

    进入python3的解释器环境. 我们让解释器输出 “Hello World!” 解释器成功的输出了Hello world!  程序就这样完成了. 当然上面的程序我们是在解释器中完成的. 我们可以通过 ...