arachni-web-ui使用

最近在玩儿arachni,想试试arachni-ui-web,于是就从github上download了arachni-ui-web代码。
发现是使用RoR,正好白天工作目前使用RoR :D ,目前也在学习RoR。
大概看了一下arachni-ui-web官方文档,但是没找到具体的使用方法。但是是使用RoR框架的,所以应该和白天工作的架构类似吧。

1. 配置文件
根据官方文档,arachni-ui-web支持两种数据库,Postgres和Sqlite3.我们就使用postgres吧。
根据官方文档,需要把database.yml.pgsql改成database.yml
cd config
mv database.yml.pgsql database.yml

2. 修改数据库编码
运行:RAILS_ENV=production rake db:create
报错:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
这时需要修改config/database.yml文件,添加红色部分。
[quote]development:
[color=red]template: template0[/color]
host: localhost
adapter: postgresql
encoding: unicode
database: arachni_development
pool: 50
username: arachni
password: secret

test: &test
[color=red]template: template0[/color]
host: localhost
adapter: postgresql
encoding: unicode
database: arachni_test
pool: 50
username: arachni
password: secret

production:
[color=red]template: template0[/color]
host: localhost
adapter: postgresql
encoding: unicode
database: arachni_production
pool: 50
username: arachni
password: secret

cucumber:
<<: *test[/quote]
然后再次运行:
RAILS_ENV=production rake db:create
这时可在postgres数据库中看到生成arachni_production

然后
[color=blue]RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake db:seed[/color]
即可生成必要设置
[color=blue]RAILS_ENV=production rails s[/color]即可启动arachni-ui-web

在浏览器中输入localhost:3000即可访问页面
管理员口令:
[color=blue]E-mail: admin@admin.admin
Password: administrator[/color]

普通用户:
[color=blue]E-mail: user@user.user
Password: regular_user[/color]
也可不使用production环境,发现development环境web渲染比production环境漂亮。
使用development环境时,rails/rake命令前面不需要[color=blue]RAILS_ENV=production[/color]这行

参考资源:
https://github.com/Arachni/arachni-ui-web/wiki
[url]http://stackoverflow.com/questions/5821238/rake-dbcreate-encoding-error-with-postgresql[/url]
[url]http://www.douban.com/note/92737624/[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值