Category Archives: System Administration

Using Subversion for Application Development and Deployment

I recently wanted to update our install of WordPress to the latest version. WordPress is a fairly easy install, and we could learn a thing or two about application set-up by examining their code. But I recently switched to using subversion to deploy and maintain our install. In just the little bit I’ve used subversion so far, I believe development and deployment of our internal applications would be simplified by employing it for all our projects. Here’s a quick outline of the process, with examples based on my WordPress deployment.

Continue reading Using Subversion for Application Development and Deployment

Best Practices for Setting MySQL Server Runtime Parameters

Since we’ll be exposing MySQL to significantly more traffic (due mainly to the transition to a database-driven version of Benchmarks Online [dbBOL]) I decided to spend some time optimizing the server’s settings. There are a number of settings that can be tweaked to improve performance. I based my decisions on the information available from the references cited and the performance statistics reported by MySQL (SQL SHOW VARIABLES or use PHPMyAdmin). MySQL has been running for 131 days as of the writing of this post (see cached copy of the runtime stats), so I expect the data will be a fairly good indication of the performance of MySQL under its current usage. Unfortunately, I expect the usage pattern to change significantly once dbBOL is released. As a result some of the settings used will be based on expected usage patterns. At specific intervals after dbBOL is released we should examine the performance of MySQL based on the runtime stats to determine if additional tweaking needs to be performed. I recommend the following schedule: 1 week, 1 month, 3 months, then every 6 months.

Continue reading Best Practices for Setting MySQL Server Runtime Parameters

Atlas/Benchmarks Databases

The data for Benchmarks Online (BOL) is pulled from various tables in the Items database. Some of these tables are also used for the Atlas Statements Database (ASD). Since staff would like for the statements in the ASD to reflect the most recent working version we needed a way to prevent this from affecting BOL, which needs to maintain a stable set of publicly available statements. As a temporary resolution the tables that are used to populate BOL have been copied into a new database called Standards. Going forward, if the content of these tables is updated and those updates need to also be reflected in BOL both copies of each table should be updated.

A long-term goal is to develop a system to contain information related to our standards documents (namely Benchmarks and Atlas). This new system should implement some kind of versioning capability so that we can maintain stable and working copies of the benchmarks statements. This would also allow us to keep better track of how resources are aligned to statements. Currently as a statement is modified we have no way of knowing the wording to which a resource has been aligned.


IIS can’t find php.ini

I installed PHP on the Windows server today and ran into what seems to be a fairly common problem (BrianW can affirm): sometimes PHP is unable to find the php.ini file when processing web-based content. In my case PHP was installed as an ISAPI filter. I suspect that when using the ISAPI filter PHP must be looking in the in the location IIS is running from, rather than the location of the ISAPI DLL (which is located in the PHP folder).

To address the problem I added a PHPRC environment variable. Now everything seems to work as expected. There are a number of options for specifying the location of the php.ini file. See the PHP documentation for runtime configuration.

IIS returns an error

If you’ve fully set up PHP and configured IIS correctly (including enabling the Web Service Extension) then one last thing to check is the path to the DLL specified for the Web Services Extension vs. the value for the application extension in the web site properties. These should match exactly.

floradev not accepting connections

Yesterday we were unable to connect to floradev via ssh or browser.  The VM control panel indicated ther server was running, no apparent alarms/warnings or recent maintenance.  We restarted the server, which seemed to correct the problem.  Today, the same problem.  Restarted the server again and inspected log files.  After about 30 mins while looking through the log files via ssh the connection was dropped, possibly due to inactivity (I was viewing the log with vi rather than tail), but again the server is not accepting new connections.  Yesterday after the reboot, I was interacting with the server regularly and never lost the connection while I was working.  In addition, I closed and reopened the connection multiple times.  This leads me to believe it has something to do with the idle/power-save or some related feature.

The only atypical log entry around the last failure:

feb 29 16:37:02 floratest syslog-ng[3165]: STATS: dropped 0

However, this event is logged regularly.

Another reason I think this related to the power-save is some error messages noted during reboot:

 Feb 29 17:05:35 floratest rcpowersaved: CPU frequency scaling is not supported by your processor.
Feb 29 17:05:35 floratest rcpowersaved: enter ‘CPUFREQD_MODULE=off’ in /etc/sysconfig/powersave/cpufreq to avoid this warning.
Feb 29 17:05:36 floratest rcpowersaved: Cannot load cpufreq governors – No cpufreq driver available
Feb 29 17:05:36 floratest [powersave]: ERROR (CPUFreq_Userspace:42) Could not set userspace governor, seems as if the cpufreq_userspace module is not loaded.
Feb 29 17:05:36 floratest [powersave]: ERROR (read_line:43) Could not open file for reading: ‘/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies’
Feb 29 17:05:36 floratest [powersave]: ERROR (read_line:43) Could not open file for reading: ‘/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq’
Feb 29 17:05:36 floratest [powersave]: ERROR (read_value:82) Could not read value in file /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq: error: No such file or directory!
Feb 29 17:05:36 floratest [powersave]: ERROR (read_line:43) Could not open file for reading: ‘/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq’
Feb 29 17:05:36 floratest [powersave]: ERROR (read_value:82) Could not read value in file /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: error: No such file or directory!
Feb 29 17:05:36 floratest [powersave]: WARNING (getMinMaxSpeeds:349) Speedstepping not supported! Was the correct cpufreq module loaded?
Feb 29 17:05:36 floratest [powersave]: WARNING (initFreqsViaTesting:377) Could not read min and max speed
Feb 29 17:05:36 floratest [powersave]: ERROR (PM_Interface:231) Cannot create cpufreq objects

These errors were also reported in a reboot that occurred last night.

This is a link to a post of someone experiencing similar problems, but no solution was posted:

image upload problem (New Items)

The researchers reported a problem uploading images while using the Add New Items section of the Items Utility.  

The researchers were unable to access the upload server directory via the fckeditor (from the fck interface, hit image upload icon and then ‘browse’ server… js error, popup interface is non-functional).  Error messages indicated a connector error.  I traced this to a setting in the fckconfig.js.  The fileBrowserLanguage setting was set to asp instead of php.  In addition, I found there were some other mods missing.  Somehow fckconfig.js was reverted back to an earlier/original version.

I found a more recent version on my local machine (last update 5/2007) which seemed to correct the problem.  However, I’m not sure when I downloaded my version (so I don’t know how old it is), and I don’t know if BS has made any revisions since 5/2007. 

This is the version I uploaded: fckconfig

WordPress Unified User Database

In order to simplify user management of WordPress blogs hosted on our site I wanted to find a way to share users between two separate set ups. This is much easier to do than I had expected. For each setup you need to make sure WordPress uses the same database but different table prefixes.

The first step is to set up the initial blog. Next, set up any additional blogs. For each additional blog you need only add two lines to the wp-config.php file:

define('CUSTOM_USER_TABLE', 'wp_users');
define('CUSTOM_USER_META_TABLE', 'wp_usermeta');

wp_users should point to the original blog user table. wp_usermeta should point to the original blog user metadata table. From here on out you can configure and manage your blogs as normal. The only difference will be that users who have not been assigned a role for a specific blog setup will be listed under the “No role for this blog” category on the Users tab.


Apache Server Status Info-URL

I’ve enabled the Apache server-status functionality on flora. The information provided by this URL may prove useful when trouble-shooting server slowdowns. We’ll be able to see which, if any, requests are taking a large amount of time to process.

Whether or not this will truly prove useful only time will tell, so let me know if you have any thoughts.

SSH Tunneling

One of the benefits of SSH is that you can tunnel communication through the SSH connection to the remote machine. These communications then act as if they are coming from the remote machine. This provides for a means of allowing access to local services without having to open additional ports on the perimeter or host firewalls.

I won’t go into details on how to accomplish this, there are plenty of tutorials out there. I just wanted to bring it to everyone’s attention as an option for server administration.