Administrator interface; mostly for reviewing 404 errors
usage, URL: site-host/admin/command.php
Pictools has a command page, at the right, for administrator tasks. The major task is error monitoring; internal errors and requests for missing pages are shown at the bottom. The date/time at the top is the server's time; errors are time stamped with the server time.
This page can only be visited by the one user who has the correct one-time cookie. To get started, edit server file /admin/.gate so it starts with your ip address and continues with ":0"; then visit /admin/command.php from that ip address.
Here's what you will find on each line.
Title line
The text at the right shows the version of Pictools in use. After years of trial and error, the official release was arbitrarily assigned version 3.3.
Top line
Sat, 21 May 16 17:34:48 -0700
mod sec errs: 0
logs/debug.txt: 318695
server time, number of daily mod_security errors, size of /admin/logs/debug.txt. If there are many mod_security errors, it may be that your hosting service has misconfigured mod_security. They may be interested to hear of it, if you can convince the customer agent to talk to the appropriate systems guy or gal.
Second line
yesterday: 1448 hits 6.37 min
Evil accesses: 1
logs/maillog.txt: 0
Number of visits to site yesterday; number of CPU minutes absorbed (ask your hosting service if this is available); visits to tarpit since last cleared; number of bytes in the maillog (see "Subscriptions", below).
Buttons line
Check Errors
Run the error checking process again. (It is usually sufficient that errors are checked when the page is displayed.) When errors are displayed, a button appears that clears most of the errors from the display list.
Accesses the server's site statistics. This just goes to URL /stats; it works on DreamHost using the id and password of the usual site login. Problematic for other hosting services.
Rebuild propcon.c
Recompile propcon on the server. You must click this button
after uploading a new version of propcon.
$sp $_SERVER $_ENV
Appends to the page the contents of the three named global values. $sp is from SiteProps; the other two are php super-globals,.
Directory line
Directory
Name of a directory. For the next two buttons.
Get Props
Displays the values of all properties applicable to the named directory.
Rebuild dir
Causes a rebuild of Pictools.php in the named directory, and all its descendants. If any Pictools.properties file is changed, you must set the directory name field to that directory and click this button. The action of the button is to delete the Pictools.php files; a directory's Pictools.php file is rebuilt the next time a page in that directory is visited.
Elective Lists
Below the Dictionary line, up to four lists may appear. Each appears only when it has data or has been requested.
Values arrays
After the "$sp $_SERVER $_ENV" button is clicked this list appears. It gives the values of four arrays within the php:
$sp values
The fields and values within the $sp object available to all clients of SiteProps, including $root, $rootlen, $thispage, $thisdir.
$_SERVER values
The fields and values of PHP's $_SERVER object, including REQUEST_URI, QUERY_STRING, SERVER_ADMIN, DOCUMENT_ROOT, HTTP_COOKIE.
$_ENV values
The fields and values of PHP's $_ENV object, including pretty much the same fields as $_SERVER.
printenv values
The result of running printenv in the seerver's shell environment. On my server, the complete list is PATH, PWD, SHLVL=1, RAILS_ENV=production, _=/usr/bin/printenv.
Report Text
These messages are replies after performing an action required by one of the buttons.
PropCon recompiled
After clicking recompile propcon button. Alternatively it can respond with an error mrssage.
Properties for /Java/: Array
( ... )
After entering a directory in the directory box and clicking the Get Props button.
Removed Pictools.php in n of count directories
After entering a directory in the box and clicking Rebuild ... button.
PHP Errors
A list of recent errors encountered in viewing pages. Typically, the requestor gets a blank response, so you should fix these problems ASAP. The log must be cleared to make these lines disappear.
Other http errors
From time to time the server encouunters errors. It logs them to /admin/logs/errors.txt. Te contents of that log are printed here. The log is cleared overnight
403/4 Errors
When /error.php is invoked as the ErrorDocument processor, it makes an entry in /admin/logs/urlerrors.log. For the usual 404 error, only one entry is made. Other errors get a second log entry adding additional information. Command.php displays the contents of this log as a table. The usual entry appears thus:
404
/pictools/doc/urlmap.php (POST)
2016 May 19 08:07:04
74.109.238.233
Usually the entries should be copied to the "observed errors" sheet in /pictools/doc/basement/badlinks.xlsx; see urlmap.
A user "subscribes" to the site by clicking the envelop/twitter-bird button at the upper-right on the home page and filling in an email address. The request arrives as a line in /admin/logs/maillog.txt. (Other mail sent leaves messages there, too, but at present no other messages are sent.) The line has a time stamp, "sub" or "unsub", and the email address. The size of the maillog is displayed at the right of the "Second line" described above.
As administrator, it is your job to collect such mesages and add or delete the recipient from the list of those alerted when the website changes. Pictools offers no support for managing or alerting the list. It would be nice to send email to incoming or outgoing subscribers. Pictools doesn't help there, either. There is some commented out code for automated emails in /admin/command.php and /manageSubscription.php. It could be reinstated in conjunction with installation of a new mail sending system. The native system creates messages that are prone to delivery to spam folders.