- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
,Disablable
,Removable
,SingleTableObject<Integer,
Site>
HttpdSite
is one unique set of web content and resides in
its own directory under /www
. Each HttpdSite
has a unique name per server, and may be served simultaneously on any
number of HttpdBind
s through any number of
HttpdServer
s.
An HttpdSite
only stores the information that is common to
all site types. The site will always reference one, and only one, other
type of entry, indicating the type of site and providing the rest of the
information about the site.
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
The site name used when an account is disabled.static final int
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
addHttpdSiteAuthenticatedLocation
(String path, boolean isRegularExpression, String authName, PosixPath authGroupFile, PosixPath authUserFile, String require, String handler) boolean
boolean
void
disable
(DisableLog dl) void
enable()
int
void
getAwstatsFile
(String path, String queryString, OutputStream out) boolean
Addedhttpd_sites.block_core_dumps
column, which enables blocking of core dumps.boolean
Enables blocking filename patterns associated with editor automatic backups.boolean
Enables the blocking of URL patterns associated with source control management systems.boolean
Enables the blocking of TRACE and TRACK HTTP methods.Lists the reasons an object may not be removed.protected Object
getColumnImpl
(int i) boolean
boolean
boolean
boolean
boolean
boolean
getHttpdSiteBinds
(HttpdServer server) int
getId()
Gets the directory where this site is installed.boolean
getName()
void
Initializes this object from the raw database contents.boolean
Checks if this object is disabled.boolean
isManual()
static boolean
isValidSiteName
(String name) Checks the format of the name of the site, as used in the/www
directory.void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
setBlockCoreDumps
(boolean blockCoreDumps) void
setBlockEditorBackups
(boolean blockEditorBackups) void
setBlockScm
(boolean blockScm) void
setBlockTraceTrack
(boolean blockTraceTrack) void
setEnableAnonymousFtp
(boolean enableAnonymousFtp) void
setEnableCgi
(boolean enableCgi) void
setEnableFollowSymlinks
(boolean enableFollowSymlinks) void
setEnableHtaccess
(boolean enableHtaccess) void
setEnableIndexes
(boolean enableIndexes) void
setEnableSsi
(boolean enableSsi) void
setIsManual
(boolean isManual) void
setPhpVersion
(SoftwareVersion phpVersion) void
setServerAdmin
(Email address) AoservObject.toString()
implementation that is allowed to throw exceptions.void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
Methods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Field Details
-
COLUMN_NAME_name
- See Also:
-
COLUMN_AO_SERVER_name
- See Also:
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTH- See Also:
-
DISABLED
The site name used when an account is disabled.- See Also:
-
-
Constructor Details
-
Site
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
Site>
-
getId
public int getId() -
getAoServer_server_pkey
public int getAoServer_server_pkey() -
getLinuxServer
- Throws:
SQLException
IOException
-
getName
-
getListFirst
public boolean getListFirst() -
getPackage_name
-
getPackage
- Throws:
SQLException
IOException
-
getLinuxAccount_username
-
getLinuxServerAccount
- Throws:
SQLException
IOException
-
getLinuxGroup_name
-
getLinuxServerGroup
- Throws:
SQLException
IOException
-
getServerAdmin
-
getDisableLog_pkey
-
getDisableLog
- Specified by:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
isManual
public boolean isManual() -
getAwstatsSkipFiles
-
getPhpVersion_pkey
-
getPhpVersion
- Throws:
IOException
SQLException
-
getEnableCgi
public boolean getEnableCgi() -
getEnableSsi
public boolean getEnableSsi() -
getEnableHtaccess
public boolean getEnableHtaccess() -
getEnableIndexes
public boolean getEnableIndexes() -
getEnableFollowSymlinks
public boolean getEnableFollowSymlinks() -
getEnableAnonymousFtp
public boolean getEnableAnonymousFtp() -
getBlockTraceTrack
public boolean getBlockTraceTrack()Enables the blocking of TRACE and TRACK HTTP methods. -
getBlockScm
public boolean getBlockScm()Enables the blocking of URL patterns associated with source control management systems. It is possible for SCM files, such asCVS/Root
and.git/config
to have authentication credentials. Leave this enabled when pulling web root content directly from revision control systems. Currently has protections for CVS, Subversion, and Git. -
getBlockCoreDumps
public boolean getBlockCoreDumps()Addedhttpd_sites.block_core_dumps
column, which enables blocking of core dumps. Core dumps could potentially expose sensitive information and have predictable filename patterns. -
getBlockEditorBackups
public boolean getBlockEditorBackups() -
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
Site> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
Site> - Throws:
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
Site> - Throws:
IOException
-
addHttpdSiteAuthenticatedLocation
public int addHttpdSiteAuthenticatedLocation(String path, boolean isRegularExpression, String authName, PosixPath authGroupFile, PosixPath authUserFile, String require, String handler) throws IOException, SQLException - Throws:
IOException
SQLException
-
canDisable
- Specified by:
canDisable
in interfaceDisablable
- Throws:
IOException
SQLException
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
getCannotRemoveReasons
Description copied from interface:Removable
Lists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasons
in interfaceRemovable
- Returns:
- an empty
List<CannotRemoveReason>
if this object may be removed, or a list of descriptions
-
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getInstallDirectory
Gets the directory where this site is installed.- Throws:
SQLException
IOException
-
isDisabled
public boolean isDisabled()Description copied from interface:Disablable
Checks if this object is disabled. This should execute very quickly (not incur any round-trip to any database) and thus does not throw any checked exceptions.- Specified by:
isDisabled
in interfaceDisablable
-
getHttpdSiteAuthenticatedLocations
- Throws:
IOException
SQLException
-
getHttpdSiteBinds
- Throws:
IOException
SQLException
-
getHttpdSiteBinds
- Throws:
SQLException
IOException
-
getHttpdStaticSite
- Throws:
IOException
SQLException
-
getHttpdTomcatSite
- Throws:
IOException
SQLException
-
getPrimaryVirtualHostName
- Throws:
SQLException
IOException
-
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
Site>
-
isValidSiteName
Checks the format of the name of the site, as used in the/www
directory. The site name must be 255 characters or less, and comprised of onlya-z
,0-9
,.
or-
. The first character must bea-z
or0-9
.Note: This matches the check constraint on the httpd_sites table. Note: This matches keepWwwDirs in HttpdSiteManager.
TODO: Self-validating type for site names (Build on PosixPortableFilename, once it exists?)
-
remove
Description copied from interface:Removable
Removes this object, and all dependant objects, from the system.- Specified by:
remove
in interfaceRemovable
- Throws:
IOException
SQLException
-
setIsManual
- Throws:
IOException
SQLException
-
setServerAdmin
- Throws:
IOException
SQLException
-
setPhpVersion
- Throws:
IOException
SQLException
-
setEnableCgi
- Throws:
IOException
SQLException
-
setEnableSsi
- Throws:
IOException
SQLException
-
setEnableHtaccess
- Throws:
IOException
SQLException
-
setEnableIndexes
- Throws:
IOException
SQLException
-
setEnableFollowSymlinks
- Throws:
IOException
SQLException
-
setEnableAnonymousFtp
- Throws:
IOException
SQLException
-
setBlockTraceTrack
- Throws:
IOException
SQLException
-
setBlockScm
- Throws:
IOException
SQLException
-
setBlockCoreDumps
- Throws:
IOException
SQLException
-
setBlockEditorBackups
- Throws:
IOException
SQLException
-
toStringImpl
Description copied from class:AoservObject
AoservObject.toString()
implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAoservObject.toString()
on the key (fromAoservObject.getKey()
). When the key isnull
, uses the default implementation fromObject.toString()
.- Overrides:
toStringImpl
in classCachedObjectIntegerKey<Site>
- Throws:
SQLException
IOException
-
getAwstatsFile
public void getAwstatsFile(String path, String queryString, OutputStream out) throws IOException, SQLException - Throws:
IOException
SQLException
-