Archive
Posts in Web
Viewing Apache apxs compiler flags
If you have used apxs to build an Apache module, you may have wondered where apxs got the linker and compiler options since they are not embedded in the apxs Perl script? The linker and compiler flags are generated by the apr-config and apu-config scripts, which contain platform specific options that are assigned at Apache build time. These options can be viewed by running apr-config or apu-config with one or more options: The Apache build system is super interesting, and I love the fact that you can easily add modules to an existing Apache installation.
$ read more →Upgrading wordpress
While reading through the wordpress dashboard this weekend, I noticed that several new security advisories were announced for the version of wordpress I was using. To mitigate potential security issues, I decided to upgrade to Wordpress 2.0.2 and Spam Karma 2.2. The upgrade process was super simple, and I will describe it below. To begin the upgrade, you need to grab the latest versions of wordpress and spam karma: Once the files have been downloaded to a location on the server you plan to upgrade, you can unzip them to a staging location ( this BLOG posting assumes that you are upgrading a version of wordpress that lives in a directory named public_html in your home directory): Once the files are extracted, you will need to copy your existing wordpress configuration file to the staging directory: If everything completed successfully, you should be able to view the new wordpress version by prepending the word staging to your wordpress administrator URL…
$ read more →Apache restart != graceful
While chatting with a friend last week, he mentioned that he uses the apachectl restart option to get Apache to reread configuration files. This works, but it forcefully terminates all children (even ones processing requests), and can lead to user sessions getting blotched. As of Apache 1.3, you can now use the apachectl graceful option to gracefully restart a web server: This utilizes the generation values in the Apache scoreboard, and allows each child to die once they complete the request processing loop. If you are interested in seeing how this is done, check out prefork.c in the Apache source code.
$ read more →Watching hook processing order
While perusing through the Apache source code, I came across this nifty little nugget of code in config.c: The getenv() call will check for an environment variable names SHOW_HOOKS. If the variable is set, Apache will display the hook processing order on stdout: This information can be useful when debugging hook placement (e.g., APR_HOOK_FIRST, APR_HOOK_LAST) issues, and is great for understanding the order in which hooks are executed.
$ read more →Apache logging options
If you use Apache version 2.X, I would recon you are using mod_log_config to log request information to the access_log (if you are not using mod_log_config, I assume you are a busy site that has disable logging to boost performance). This is a nifty module, and after reading the source (the source for mod_log_config is located in SRCROOT/modules/loggers/mod_log_config.c I learned that this module` has TONS of nifty options to control what gets logged. In addition to logging request data and browser information, you can also log cookie data, request processing time (this requires mod_status and ExtendedStatus), HTTP headers, notes, IP addresses, ports, and numerous other options. If you are using logfile analysis utilities that require Custom/Combined formatted access_logs, you need to be careful where you add these options to avoid breaking your reporting tools…
$ read more →