parallel-flickr 轻松入门 安装简介 简短版 稍微有点手工的长版 这里有龙 当地主机 ...
parallel-flickr is a tool for backing up your Flickr photos and generating a database backed website that honours the viewing permissions you've chosen on Flickr. It uses the Flickr API as a single-sign-on provider, for user accounts, and to archive the photos, favourites and contact list from your Flickr account.
parallel-flickr is not a replacement for Flickr. It is an effort to investigate – in working code – what it means to create an archive of a service as a living, breathing "shadow" copy rather than a snapshot frozen in time.
parallel-flickr is still a work in progress. It is more than an idle research project. It is working code that I use every day. On the other hand it is also not a full-time gig so I work on it during the mornings and the margins of the day so it is not pretty or particularly classy, yet.
It almost certainly still contains bugs, some of them might be a bit stupid. That includes this documentation which aims to be basically completely but is not yet completely complete.
There is still not a one-button installation process and configuring parallel-flickr might seem a bit daunting for that reason. This is far from ideal and there is lots of room for improvement in the future. Suggestions and gentle cluebats are welcome and encouraged.
The longer versions are contained in a variety of blog posts and talks that I've done about parallel-flickr:
Parallel Flickr, October 2011
A talk about Parallel Flickr at the Personal Digital Archiving conference, February 2012
parallel-flickr is built on top of Flamework which means it's nothing more than a vanilla Apache + PHP + MySQL application. You can run it as a dedicated virtual host or as a subdirectory of an existing host.
You will need to make a copy of the config.php.example file and name it config.php. You will need to update this new file and add the various specifics for databases and third-party APIs.
# You will need valid Flickr API credentials
# See also: http://www.flickr.com/services/apps/create/apply/
$GLOBALS['cfg']['flickr_api_key'] = '';
$GLOBALS['cfg']['flickr_api_secret'] = '';
$GLOBALS['cfg']['flickr_api_perms'] = 'read';
# You will need to setup a MySQL database and plug in the specifics
# here: https://github.com/straup/parallel-flickr/blob/master/schema
# See also: https://github.com/straup/flamework-tools/blob/master/bin/setup-db.sh
$GLOBALS['cfg']['db_main'] = array(
'host' => 'localhost',
'name' => 'parallel-flickr',
'user' => 'parallel-flickr',
'pass' => '',
'auto_connect' => 1,
);
# You will need to set up secrets for the various parts of the site
# that need to be encrypted. Don't leave these empty. Really.
# You can create new secrets by typing `make secret`.
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/generate_secret.php
$GLOBALS['cfg']['crypto_cookie_secret'] = '';
$GLOBALS['cfg']['crypto_crumb_secret'] = '';
$GLOBALS['cfg']['crypto_password_secret'] = '';
# If you don't have memcache installed (or don't even know what that means)
# just leave this blank. Otherwise change the 'cache_remote_engine' to
# 'memcache'.
$GLOBALS['cfg']['cache_remote_engine'] = '';
$GLOBALS['cfg']['memcache_host'] = 'localhost';
$GLOBALS['cfg']['memcache_port'] = '11211';
# This is only relevant if are running parallel-flickr on a machine where you
# can not make the www/templates_c folder writeable by the web server. If that's
# the case set this to 0 but understand that you'll need to pre-compile all
# of your templates before they can be used by the site.
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/compile-templates.php
$GLOBALS['cfg']['smarty_compile'] = 1;Get the code from GitHub.
Decide on whether you'll host this on a sub-domain (something along the lines of parallel-flickr.example.com) or in a subdirectory (maybe something like www.example.com/parallel-flickr).
This rest of this section will assume the following:
parallel-flickr.example.com. Just mentally substitute your domain and sub-domain when reading, and physically substitute your domain and sub-domain during the installation process. Unless you actually own the example.com.reverse-geoplanet web-service.parallel-flickr.example.com and not parallel-flickr.example.com/wwwRegister with Flickr - go to http://www.flickr.com/services/apps/create/apply/
parallel-flickr (or something that's meaningful to you)Now ... upload the code, plus all sub-directories to your web-server; don't forget the (hidden) .htaccess file in the root of the code's distribution.
Copy /www/include/config.php.example to /www/include/config.php and edit this new file.
Copy-and-paste your Flickr Key into the section of the config file that looks like ...
$GLOBALS['cfg']['flickr_api_key'] = 'my-flickr-key-copied-in-here';
$GLOBALS['cfg']['flickr_api_secret'] = 'my-flickr-secret-copied-in-here';
$GLOBALS['cfg']['flickr_api_perms'] = 'read';Set up your database name, database user and database password. Copy and paste these into ...
$GLOBALS['cfg']['db_main'] = array(
'host' => 'localhost',
'name' => 'my-database-name',
'user' => 'my-database-user',
'pass' => 'my-database-users-password',
'auto_connect' => 0,
);Setup your encryption secrets secrets. SSH to your host and run php /bin/generate_secret.php, 3 times. Copy and paste each secret into
$GLOBALS['cfg']['crypto_cookie_secret'] = 'first-secret-here';
$GLOBALS['cfg']['crypto_crumb_secret'] = 'second-secret-here';
$GLOBALS['cfg']['crypto_password_secret'] = 'third-secret-here';(If you don't have shell access to your web-server, you can run this command from the shell on a local machine)
Create the database tables. Load /schema/db_main.schema, /schema/db_tickets.schema and /schema/db_users.schema into the database. You can do this either via phpMyAdmin and the import option or via mysql on the shell's command line
Browse to http://parallel-flickr.example.com
If you get errors in your Apache error log such as ...
www/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration... then your host is probably running PHP as a CGI and not as a module so you'll want to comment out any line in /www/.htaccess that starts with php_value or php_flag and put these values into a new file, /www/php.ini, without the leading php_value or php_flag.
Click on sign in w/ flickr and authenticate with Flickr.
You might want to put this command in a cron job, if your web host allows this.
That's it. Or should be. If I've forgotten something please let me know or submit a pull request.
If you really want to hack and play around with parallel-flickr, it's best to do this on a private, locally hosted machine, like your laptop or your desktop machine. But as a starting point you need to have followed the installation instructions above as you need to have a public facing installation first and then clone this to your local machine. The reason for this is that you need to authenticate with Flickr, Flickr uses FlickrAuth or OAuth to authenticate and OAuth authentication needs a publicly accessible web server to authenticate with. With that said, roll up your sleeves, grab a cup of your caffeinated beverage of choice and follow along.
This rest of this section will assume the following:
parallel-flickrSo ... firstly create a local host name by adding parallel-flickr to your /etc/hosts file, which will look something like this ...
127.0.0.1 localhost parallel-flickrOn some operating systems, this file is re-read each time your browser is re-started. On Mac OS X, you'll also need to flush and reload the machine's DNS cache ...
$ sudo /usr/bin/dscacheutil -flushcacheNow create a new virtual host on your machine. Edit /Applications/MAMP/conf/apache/httpd-vhosts.conf and append the magic incantation ...
ServerName parallel-flickr:8888
DocumentRoot "/Applications/MAMP/htdocs/parallel-flickr/www"Restart Apache in MAMP. Create /Applications/MAMP/htdocs/parallel-flickr/www. Browse to http://parallel-flickr:8888. Check you get an empty directory listing of / to e
暂无开放 Issues,或尚未同步最近议题。