# File lib/phusion_passenger/platform_info/apache.rb, line 185
        def self.httpd_actual_error_log(options = nil)
                if config_file = httpd_default_config_file(options)
                        contents = File.read(config_file)
                        # We don't want to match comments
                        contents.gsub!(/^[ \t]*#.*/, '')
                        if contents =~ /^ErrorLog (.+)$/
                                filename = $1.strip.sub(/^"/, '').sub(/"$/, '')
                                if filename.include?("${")
                                        log "Error log seems to be located in \"#{filename}\", " +
                                                "but value contains environment variables. " +
                                                "Attempting to substitute them..."
                                end
                                # The Apache config file supports environment variable
                                # substitution. Ubuntu uses this extensively.
                                filename.gsub!(/\$\{(.+?)\}/) do |varname|
                                        if value = httpd_infer_envvar($1, options)
                                                log "Substituted \"#{varname}\" -> \"#{value}\""
                                                value
                                        else
                                                log "Cannot substituted \"#{varname}\""
                                                varname
                                        end
                                end
                                if filename.include?("${")
                                        # We couldn't substitute everything.
                                        return nil
                                end
                                if filename !~ /\A\//
                                        # Not an absolute path. Infer from root.
                                        if root = httpd_root(options)
                                                return "#{root}/#{filename}"
                                        else
                                                return nil
                                        end
                                else
                                        return filename
                                end
                        elsif contents =~ /ErrorLog/
                                # The user apparently has ErrorLog set somewhere but
                                # we can't parse it. The default error log location,
                                # as reported by `httpd -V`, may be wrong (it is on OS X).
                                # So to be safe, let's assume that we don't know.
                                return nil
                        else
                                return httpd_default_error_log(options)
                        end
                else
                        return nil
                end
        end