加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

BrowserShot搭建

发布时间:2020-12-13 17:51:50 所属栏目:百科 来源:网络整理
导读:看了网上各个文章,自己也摸索了很久,才搭建出这套BrowserShot的环境,放在这里大家一起讨论下吧。目前的BrowserShot只能进行静态页面的检查,颇有不足。 Browsershots:通过在不同操作系统下用不同浏览器渲染您的网页,然后获取截图的方法来测试网站的浏览

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

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

Browsershotes 服务器安装

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

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

BrowserShot Factory 安装(windows)

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读