在Debian 7系统安装 MediaDrop - 视频分享站点程序
感谢罗老板。
目的:在Debian 7 64位系统上安装视频分享站点程序——MediaDrop 。
难点:MediaDrop的安装源在国外,python包有依赖,可能需要多次尝试,才能完成。
过程:
1.先使用网易的软件库源替换默认的阿里云源。原因可能阿里云源未更新,可能会出现 “x86_64-linux-gnu-gcc: error: unrecognized command line option” 的错误
deb http://mirrors.163.com/debian/ wheezy main non-free contrib
deb http://mirrors.163.com/debian/ wheezy-updates main non-free contrib
deb http://mirrors.163.com/debian/ wheezy-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib
deb-src http://mirrors.163.com/debian/ wheezy-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ wheezy-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib
2.更新软件库:
apt-get update
3.安装相应的软件:
apt-get install mysql-server mysql-client libjpeg-dev zlib1g-dev libfreetype6-dev libmysqlclient-dev python-dev python-setuptools python-virtualenv git
4.切换到根目录, 创建虚拟python环境:
cd /
virtualenv --no-site-packages venv
source venv/bin/activate
5.获取 MediaDrop 的安装文件:
git clone git://github.com/mediadrop/mediadrop.git mediadrop-git
6.切换到 MediaDrop 目录,下载安装依赖包:
cd mediadrop-git
python setup.py develop
7.生成 deployment.ini 配置文件
paster make-config MediaDrop deployment.ini
8.连上mysql服务端,创建好程序要用到的mysql数据库和用户:
mysql -u root -p
create database mediadrop_db;
grant usage on mediadrop_db.* to mediadrop_user@localhost identified by 'aliyun888';
grant all privileges on mediadrop_db.* to mediadrop_user@localhost;
exit;
9.修改配置文件 deployment.ini 中的mysql连接参数,如此例中的,修改后是:
sqlalchemy.url = mysql://mediadrop_user:aliyun888@localhost/mediadrop_db?charset=utf8&use_unicode=0
10.补装 aniso8601 的ptyhon包:
pip install aniso8601
11.安装主体程序:
paster setup-app deployment.ini
12.更新数据库,利于全文搜索:
mysql -u root mediadrop_db < setup_triggers.sql -p
13.启动测试,如果顺利,可以通过 http://ip:8080 访问到站点前台:
paster serve --reload deployment.ini
源文: UBUNTU SERVER 14.04 (TRUSTY TAHR) – QUICK MEDIADROP INSTALLATION, https://pricklytech.wordpress.com/2014/08/19/ubuntu-server-14-04-trusty-tahr-quick-mediadrop-installation/