BrowserShot搭建

前端之家收集整理的这篇文章主要介绍了BrowserShot搭建前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

看了网上各个文章,自己也摸索了很久,才搭建出这套BrowserShot的环境,放在这里大家一起讨论下吧。目前的BrowserShot只能进行静态页面的检查,颇有不足。

Browsershots:通过在不同操作系统下用不同浏览器渲染您的网页,然后获取截图的方法来测试网站的浏览器兼容性

Browsershotes 服务器安装

安装netpbm@H_404_7@ yum install netpbm netpbm-progs@H_404_7@ 安装Django@H_404_7@ svn checkout http://code.djangoproject.com/svn/django/tags/releases/1.0.4 django@H_404_7@ cd django@H_404_7@ python setup.py install@H_404_7@ 安装Postgresql@H_404_7@ yum install postgresql84 postgresql84-server postgresql-python@H_404_7@ yum install python-psycopg2@H_404_7@ service postgresql start@H_404_7@ createdb shotserver04@H_404_7@ createuser eric -W –P@H_404_7@ Enter password for new role:123456@H_404_7@ Enter it again:123456@H_404_7@ Shall the new role be a superuser? (y/n) y@H_404_7@ vi /var/lib/pgsql/data/pg_hba.conf #将其中的method全改成md5@H_404_7@ service postgresql restart@H_404_7@ 安装ShotServer@H_404_7@ svn checkout http://browsershots.googlecode.com/svn/trunk/shotserver shotserver@H_404_7@ cd shotserver@H_404_7@ python settings.py install@H_404_7@ cd /usr/lib/python2.4/site-packages/shotserver04@H_404_7@ vi settings.py@H_404_7@ DATABASE_ENGINE = ‘postgresql_psycopg2′@H_404_7@ DATABASE_NAME = ‘shotserver04′@H_404_7@ DATABASE_USER = ‘eric’@H_404_7@ DATABASE_PASSWORD = ’123456′@H_404_7@ DATABASE_HOST = ‘localhost’@H_404_7@ python manage.py syncdb@H_404_7@ mkdir -p /var/www/v04.browsershots.org/png #若在settings.py中将PNG_ROOT修改过,则按修改内容进行目录创建@H_404_7@ chmod 777 /var/www/v04.browsershots.org/png@H_404_7@ 修改settings.py文件,将PNG_URL、API_URL、ZIP_URL的IP设置成当前服务器的IP地址@H_404_7@ 启动ShotServer服务@H_404_7@ python manage.py runserver 192.168.101.162:8000@H_404_7@ 访问http://192.168.101.162:8000,查看能否正确访问

设置中文显示@H_404_7@ 修改setting.py文件,将@H_404_7@ TIME_ZONE = ‘Asia/Shanghai‘@H_404_7@ LANGUAGE_CODE = ‘zh-cn‘@H_404_7@ 同时在LANGUAGE里面加入一行(‘zh-cn’,u’简体中文’)

BrowserShot Factory 安装(windows)

安装python、activepython、pywin32、pil@H_404_7@ 解压shotfactory-0.4-beta2、reschange_312、PrcView_5_2_15@H_404_7@ 设置系统Path环境变量,在原Path变量里添加python的执行路径以及reschange和Prcview的存放路径@H_404_7@ 使用浏览器访问http://shotserverIP:8000,登录后进行Factory的添加,并进行Browser的注册。@H_404_7@ 完成后在命令行中运行python shotfactory.py -s http://shotserverIP:8000

注意点: 客户机的计算机名需要为英文,否则在ShotServer中无法注册相应的Factory。

猜你在找的Postgre SQL相关文章