Commons:Monuments database/Setup/In labs

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Instructions on setting it up in lab (generalizable to other environments too)

  1. Created instance, Ubuntu 12.04
  2. Setup LAMP via `tasksel`
  3. check out PyWikipedia from Trunk (http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/) - needs to be packaged up later.
  4. Setup mysql config for the bot at https://commons.wikimedia.org/wiki/Commons:Monuments_database/Setup
  5. run pywikipedia/generate_user_files.py.
    1. Generate user_config.py
    2. Pick wikipedia
    3. Pick en
    4. Bot's user name (wlm-mobile-bot)
    5. Small variant
    6. add db_username, db_password and db_hostname to the file manually.
    7. user-config.py is generated, is copyable and reusable.
  6. run pywikipedia/login.py to check if login is setup properly
  7. Check out https://svn.toolserver.org/svnroot/p_erfgoed/erfgoedbot/
  8. Setup a mysql user and database, and make sure the user has access to the database.
  9. set config from 8 in erfgoedbot/monuments_config.py (database and host info)
  10. run monument_tables.py to generate sql statements in sql/. See FIXME down. Must manually replace toolserver hostname in a few sql statements with appropriate db hostname.
  11. set PYTHONPATH to include path to the pywikipedia source.
  12. install the python-mysqldb package
  13. Run update_database.py to start the update process.
  14. Run sql/fill_table_monuments_all.sql to aggregate all the different monument data into one.
  15. Checkout https://svn.toolserver.org/svnroot/p_erfgoed/api/ into ~/public_html/api, symlink it to /var/www/api
  16. Checkout https://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/ToolserverI18N/ into ~/ToolserverI18N.
  17. Create ~/database.inc, overriding whatever needs changing from api/includes/Defaults.php: $dbServer, $dbUser, $dbDatabase, $dbPassword, $dbMiserMode, $tsI18nDir.
  18. Setup cron to run once a day, with something along the lines of http://hastebin.com/deranawuci.js