You are here

class hostingService_http_apache in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 web_server/hosting_web_server.service.inc \hostingService_http_apache
  2. 7.3 web_server/hosting_web_server.service.inc \hostingService_http_apache

Hierarchy

Expanded class hierarchy of hostingService_http_apache

File

web_server/hosting_web_server.service.inc, line 24

View source
class hostingService_http_apache extends hostingService_http_public {
  public $type = 'apache';
  protected $has_restart_cmd = TRUE;
  function default_restart_cmd() {
    $command = '/usr/sbin/apache2ctl';

    # a proper default for most of the world
    foreach (explode(':', $_SERVER['PATH']) as $path) {
      $options[] = "{$path}/apache2ctl";
      $options[] = "{$path}/apachectl";
    }

    # try to detect the apache restart command
    $options[] = '/usr/local/sbin/apachectl';

    # freebsd
    $options[] = '/usr/sbin/apache2ctl';

    # debian + apache2
    $options[] = $command;
    foreach ($options as $test) {
      if (is_executable($test)) {
        $command = $test;
        break;
      }
    }
    return "sudo {$command} graceful";
  }

}

Members