-
Notifications
You must be signed in to change notification settings - Fork 178
InstallCharts
Setting up the charts is probably the least automated part of setting up the mirror. Thankfully, these get touched the least; it will be rare that I ask you to update the chart scripts; or warn that your charting might break.
Many of you are looking at this in response to a recent email (June 9, 2016).
rsync -a [email protected]:stable/extras/. falling-sky-extras- Update your crontab
- Remove
falling-sky-chart.pl - Replace with
falling-sky-dyngraphs-csv.pl - Optionally, add either
--days 750or--since 2010/05/10
- Remove
Mine looks like this:
% crontab -l
# m h dom mon dow command
[email protected]
*/15 * * * * rsync -avq "[email protected]:stable/content/." /var/www/. --delete --exclude site
0 * * * * /home/jfesler/falling-sky-extras/falling-sky-dyngraphs-csv.pl --config /var/www/site/config.js --since 2010/05/01
-
perl. I've tested 5.10 myself; nothing is fancy here though. - perl modules:
JSON,DBI,DBD::mysql,Socket6 - patience, and perhaps a willingness to improve these docs for others
-
RRD is no longer used, period.librrdtoolwith developer headers
- rsync -a [email protected]:stable/extras/. falling-sky-extras
- Or clone the github repo at https://github.com/falling-sky/extras
After extracting the files from the archive, you'll see (at least) these:
-
falling-sky-dyngraphs-csv.plis the database updater and CSV file generator. -
falling-sky-chart.sqlis the SQL setup for the database -
falling-sky-chart.a29.plis the PII removal script (needed just once, see bottom of page)
Obsolete:
-
falling-sky-chart.plis the charting script.- Updates the database
- Produces RRD files and images
- Now obsolete: We no longer refer to the output from this.
Do this only if you have not set up the database yet.
Database setup is required for both storing end user results, as well as generating graphs.
These instructions assume you're at least a bit familiar with mysql. If not, seek competent help. Or consider skipping this feature of the mirror site entirely.
- This is the same
create.sqlas found in the charts directory. - You will be asked for the password.
- This command will drop any previous tables you had in this database; only run this once.
In your site's private.js you'll need to configure the database host, database name, username, and password. This should be in your site's /site/private.js file. On my server, this is in /usr/local/www/data/virt/beta.test-ipv6.com/site/private.js (as an example).
PrivateConfig =
{
...
"db": {
"host": "localhost",
"db": "testipv6",
"username": "sampleusername",
"password": "samplepassword",
},
...
}Your config.js will also need updating. Make sure that in the options section, that "survey" is enabled and configured like this:
MirrorConfig =
{
...
"options": {
"show_stats": "/stats.html",
"survey": "/survey.php",
"comment": "/comment.php",
"ip": "/ip/",
},
...Visit your site. Make sure the survey runs. You'll know by the message "(Updated server side IPv6 readiness stats)". If you have errors, fix them, before worrying too much about charts.
./falling-sky-dyngraphs-csv.pl --config /path/to/site/config.js
This should produce /path/to/site/graphdata.csv and /path/to/site/graphdata_100.csv
If you like what you see (warning: You may not have much data yet..), then you can set up a cron job. You can also relocate the falling-sky-chart.pl script to the location of your choice.
Use crontab -e if you're using per-user crontabs; or edit /etc/crontab . The recommended frequency for updating graphs is hourly.
# Example of a per-user crontab
MAILTO: [email protected]
0 * * * * /path/to/falling-sky-dyngraphs-csv.pl --config /path/to/config.js --days 750
If you're using /etc/crontab it might need to look more like this:
# Example for /etc/crontab entry
MAILTO: [email protected]
0 * * * * username /path/to/falling-sky-dyngraphs-csv.pl --config /path/to/config.js --days 750
You can specify a start date instead of number of days. The following example will capture from May 1, 2010. The format is important (sorry, non-US folks!). Be sure to use YYYY-MM-DD here.
# Example of a per-user crontab
MAILTO: [email protected]
0 * * * * /path/to/falling-sky-dyngraphs-csv.pl --config /path/to/config.js --since 2010/05/01
By default, we stopped recording IP addresses in October 2013. This is due to the number of mirrors operating in jurisdictions where there are strict operating requirements when it comes to personally identifiable information. Short of having everyone consult local legal advice, we have just simply stopped collecting the data. We also stopped using cookies (previously used to detect when one visitor visited more than once in 24 hours).
This .. has had an impact on research capabilities.
If you have an older mirror, and you want to remove IP address data from the database (without resetting the stats), do the following to remove all potential PII.
mysql -h databasehost -u databaseuser -p databasename
[password]
mysql> update survey set ip="a29" where ip != '';
mysql> update survey set ip6="a29" where ip6 != '';
mysql> update survey set ip4="a29" where ip4 != '';
mysql> update survey set survey.cookie = rand() where survey.cookie != '';
Easier alternate
If you upgrade your "extras" directory, you can run
falling-sky-chart.a29.pl --config /path/to/site/config.js
... which will do the same SQL statements documented above.
- Install - Installation Outline
- SSL-and-HTTP-2-plans
- Developers
- Community
- New Mirrors
- Working notes