国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

阿里云centos環(huán)境配置與django部署

2019-11-14 17:30:14
字體:
供稿:網(wǎng)友

1. 免密碼登陸

# 本機生成密鑰, 并將 pub 復(fù)制到阿里云服務(wù)器上$ ssh-keygen -t rsa -P ''  # -P表示密碼,-P '' 就表示空密碼$ scp ~/.ssh/FILENAME.pub root@server_ip:/root# 阿里云服務(wù)器上將 pub 放入 authorized_keys 中# cat FILENAME.pub >> ~/.ssh/authorized_keys# chmod 600 ~/.ssh/authorized_keys

2. yum

默認(rèn)的環(huán)境并不 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.22-40.el5.centos.noarch.rpmyum-fastestmirror-1.1.16-21.el5.centos.noarch.rpmyum-metadata-parser-1.1.2-4.el5.x86_64.rpm

2)  安裝命令

rpm -ivh yum-*

注意:yum和yum-fastestmirror相互依賴,所以需要同時安裝。

3) 恢復(fù) /etc/yum.conf 文件, 一般卸載時會自動備份.

3. 開發(fā)環(huán)境依賴包更新

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

4. python

手動編譯安裝 Python, 官網(wǎng)下載源碼即可.

./configure  --enable-shared  # if not, error -- libpython2.7.a:  could not read symbols: Bad valuemakemake 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.7.conf# 加入內(nèi)容:/usr/local/lib#保存退出后運行:$ ldconfig

pip 與 庫. 源碼 setup.py 安裝 setuptools 與 pip

yum install -y  python-setuptools python-develsudo 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.1.tar.gz$ cd git-2.1.1$ autoconf $ ./configure$ make $ make install

6. MySQL

# rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm  # 導(dǎo)入第三方源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

 字符編碼設(shè)置:

http://m.survivalescaperooms.com/misspy/p/4033352.html

開機自動啟動

# chkconfig --levels 235 mysqld on# service mysqld restart

 

7. apache2 與 mod_wsgi

# yum install httpd httpd-devel# chkconfig --levels 235 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.7/site-packages/django/contrib/admin/static/admin/Alias /static/ /var/www/django_server/static/

 


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 富川| 临安市| 舒兰市| 闸北区| 吉林市| 合山市| 交口县| 察雅县| 泸州市| 常熟市| 扶沟县| 纳雍县| 奉节县| 平陆县| 靖边县| 安徽省| 高平市| 大竹县| 饶河县| 塔城市| 石渠县| 青冈县| 平昌县| 安平县| 闵行区| 兴业县| 伽师县| 饶阳县| 英超| 乌拉特后旗| 清丰县| 措美县| 佛教| 龙陵县| 乌恰县| 双峰县| 延津县| 房产| 松江区| 厦门市| 德钦县|