Requirements & Installation

  • You need a web server with PHP and Python scripting enabled. Plenty of web resources exist to guide you through configuration of your particular web server. In addition, you need to have the 'dateutil' module available through Python. To check, start Python and type
    import datetime
    from dateutil.relativedelta import relativedelta, MO, TU, WE, TH, FR, SA, SU
    
    If either of these give an import error, contact your local system administrator or check for a different version of Python to run. It is not uncommon to have many versions of Python living together on the same server for compatibility with pyraf and the STSCI Python packages. This was built and tested using Python v2.5

  • You also need BeautifulSoup, and installation is a snap if you don't already have it. Grab v3.0.8 for Python 2.x, and 3.1 for Python 3.0 or higher. Simply copy the BeautifulSoup.py file to the same place as the astroph.py file, or have your local system administrator do it for you. If you are running Python 3.0, then you might want to investigate writing the parsing routines in something else, as parsing with BeautifulSoup 3.1 can be significantly worse due to the *removal* of some features (SGMLParser) in Python 3.0. Yay Python.

  • The Perms.sh file will attempt to set the permissions necessary for you, but you should double check to see if the choices make sense. Permission errors will cause the scripts to fail silently and not update anything.
    • The *.php files, papers, and dregs.log will all be continually updated, and so need to have read/write access enabled (chmod 666). You will want to update the *.txt files to customize your page, but after that they only need read access enabled (chmod 444), as do the *.py files. ./Archive needs full read/write access as well.

  • One should change the username, password, and salt variables in the passwords.py file in the ./Private directory, run it, and then copy the output MD5 hashes of the username and password, and the plaintext salt into the listmanager.php file. This insures a bit more security than having the username and password in plaintext in the listmanager.php file, though the salt is there for any enterprising young hacker. I'd reccomend moving this directory to a private user directory after the initial setup.

  • Determine the path to your python executable and set the $python variable in both index.php and listmanager.php to point towards it. This also allows you to specify a particular version if multiple exist. Typically the full path is required, though not always. If in doubt, ask your sysadmin.

  • To control access and try to prevent spam, determine your CIDR address range and change the htaccess file to match. This will give a 403 Forbidden error to any address not in the CIDR range, and is a quick and easy way to prevent spam bots from polluting the page. You can also add specific IPs to allow, though this is a bit difficult unless you have a static IP address. Most household IP addresses (Comcast, etc.) are dynamic, and can change every few days. The htaccess file included in the tarball is an example of what I use, *and should be renamed to .htaccess after you determine your CIDR range.*

  • At this point, everything should be set up. Open a terminal window to the appropriate directory, and type './runcoffee.py'. After about a minute (see below for an explanation for the delay) the script should exit. Type 'ls -lart', and you should see two new files, "astro_coffee.php" and "astro_coffee_temp.php".

  • Open a web browser, point it to 'http://yourserver/index.php', and the page should pop up. A file "astro_coffee_sample.php" is also included as an example of the general format to expect for the file.