Web_Module

Web server and package management
extends Module\Skeleton\Standard implements Opcenter\Contracts\Hookable
Methods Summary
public
# __construct( )
void __construct(void)

ignore


Overrides

public
public
# user_service_enabled( string $user , string $svc )
User capability is enabled for web service Possible values subdomain, cgi
public
# validate_subdomains( )
Sweep all subdomains to confirm accessibility
public
# is_subdomain( string $hostname )
Check if hostname is a subdomain
public
# subdomain_accessible( $subdomain )
public
# get_user( string $hostname , string $path = '' )
Get assigned web user for host/docroot

see

get_sys_user()
public
# get_sys_user( )
Get HTTP system user HTTP user has limited requirements except read. In a PHP-FPM environment, no write access is permitted by this user.
public
# normalize_path( string $hostname , string $path = '' )
Retrieve document root for given host Doubly useful to evaluate where documents will be served given a particular domain
public
# get_docroot( $hostname , string $path = '' )
Get document root from hostname
public
# import_subdomains_from_domain( string $target , string $src )
Import subdomains from domain
public
# list_subdomains( string $filter = '', string|array $domains = array ( ) )
List subdomains on the account Array format- subdomain => path
public
# subdomain_info( string $subdomain )
Get detailed information on a subdomain Response: path (string): filesystem location active (bool): subdomain references accessible directory user (string): owner of subdomain type (string): local, global, or fallthrough
public
# subdomain_exists( string $subdomain )
Check if named subdomain exists Fallthrough, local, and global subdomain patterns are valid

see

add_subdomain()
public
public
# split_host( string $host )
Split hostname into subdomain + domain components
public
# normalize_hostname( string $host )
Get the normalized hostname from a global subdomain
public
# domain_info( string $domain )
Get information on a domain Info elements path (string): filesystem path active (bool): domain is active and readable user (string): owner of directory
public
# domain_exists( string $domain )
Test if domain is attached to account aliases:list-aliases is used to check site configuration for fixed aliases aliases:list-shared-domains checks presence in info/domain_map

see

aliases_domain_exists()
public
# get_hostname_from_docroot( string $docroot )
Get hostname from location
public
# get_all_hostnames_from_path( string $docroot )
Given a docroot, find all hostnames that serve from here

xxx


public
# extract_components_from_path( string $docroot )
Decompose a path into its hostname/path components
public
# bind_dav( string $location , string $provider )
Assign a path as a DAV-aware location
public
public
# allow_protocol( string $hostname , string $proto = 'http10' )
Permit a disallowed protocol access to hostname
public
# protocol_disallowed( string $hostname , string $proto = 'http10' )
Specified protocol is disallowed
public
# disallow_protocol( string $hostname , string $proto = 'http10' )
Disallow protocol
public
# unbind_dav( $location )
public
public
public
# _edit_user( string $userold , string $usernew , array $oldpwd )
public
# rename_subdomain( string $subdomain , string $newsubdomain = NULL, string $newpath = NULL )
Rename a subdomain and/or change its path
public
# remove_subdomain( string $subdomain , bool $keepdns = false )
Remove a subdomain
public
# purge( )
Clear path cache
public
# map_subdomain( string $mode , string $subdomain , string $path = NULL, string $user = NULL )
Manage subdomain symlink mapping

todo


public
# add_subdomain( string $subdomain , string $docroot )
Add subdomain to account There are 3 types of subdomains: Local- subdomain includes subdomain + domain - foo.bar.com Fallthrough- subdomain is named after domain - bar.com Global- subdomain excludes domain - foo
public
# add_subdomain_raw( $subdomain , $docroot )
public
# status( )
Get Apache service status
public
# _create( )
Account created

Implementation of

public
# _verify_conf( Opcenter\Service\ConfigurationContext $ctx )
public
# _reload( $why = NULL )
public
public
# _cron( Cronus $c )
public
public
public
public
public
# remove_user_subdomain( string $user )
Removes all subdomains associated with a named user
public
# inventory_capture( array $sites = NULL )
Bulk screenshot of all sites
public
# capture( string $hostname , string $path = '', Service\BulkCapture $service = NULL )
Capture screenshot of site

XXX


public
Methods inherited from Module\Skeleton\Standard
__construct(), setUserParameters(), autoloadModule(), __wakeup(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), cleanUserParameters(), query()
Constants Summary
public array DEPENDENCY_MAP
# array ( 0 => 'ipinfo', 1 => 'ipinfo6', 2 => 'siteinfo', 3 => 'dns', 4 => 'cgroup', )
public string MAIN_DOC_ROOT
# '/var/www/html'
public string WEB_USERNAME
# 'apache'
public int WEB_GROUPID
# 48
public string PROTOCOL_MAP
# '/etc/httpd/conf/http10'
public string SUBDOMAIN_ROOT
# '/var/subdomain'
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties Summary
protected $pathCache

# array ( )
protected $service_cache

# NULL
protected $exportedFunctions

# array ( '*' => 2, 'add_subdomain_raw' => 18, 'host_html_dir' => 3, 'reload' => 10, 'status' => 8, 'get_sys_user' => 15, 'capture' => 18, 'inventory_capture' => 8, )
protected $hostCache

# array ( )
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id