# File src/ruby_supportlib/phusion_passenger/platform_info/apache.rb, line 114
    def self.apache2ctl_V(options = nil)
      if options
        apache2ctl = options[:apache2ctl] || self.apache2ctl(options)
      else
        apache2ctl = self.apache2ctl
      end
      if os_name_simple == "linux" &&
         linux_distro_tags.include?(:gentoo) &&
         apache2ctl == "/usr/sbin/apache2ctl"
        # On Gentoo, `apache2ctl -V` doesn't forward the command to `apache2 -V`,
        # but instead prints the OpenRC init system's version.
        # https://github.com/phusion/passenger/issues/1510
        if options
          httpd = options[:httpd] || self.httpd(options)
        else
          httpd = self.httpd
        end
        version_command = httpd
      else
        version_command = apache2ctl
      end

      if version_command
        create_temp_file("apache2ctl_V") do |filename, f|
          e_filename = Shellwords.escape(filename)
          output = `#{version_command} -V 2>#{e_filename}`

          if $? && $?.exitstatus == 0
            stderr_text = File.open(filename, "rb") do |f2|
              f2.read
            end
            # This stderr message shows up on Ubuntu. We ignore it.
            stderr_text.sub!(/.*Could not reliably determine the server's fully qualified domain name.*\r?\n?/, "")
            # But we print the rest of stderr.
            STDERR.write(stderr_text)
            STDERR.flush

            output
          else
            nil
          end
        end
      else
        nil
      end
    end