Axis Ubuntu User manual

GettingStarted–Ubuntu
AXISVideoHostingSystem

Aboutthisdocument
ThismanualisintendedforintegratorsandadministratorsofAXIS
VideoHostingSystem(AVHS)andisapplicableforsoftwarerelease
3.andlater.Itincludesinstructionsforadaptingandmanagingthe
system.PreviousexperienceandknowledgeofLinux-basedsystems,
PHPscripting,shellscriptingandnetworkingisrequired.Laterversions
ofthisdocumentwillbemadeavailableontheAVHSwebsiteavailable
fromthePartnerPagesonwww.axis.com/partner
IntellectualPropertyRights
AxisABhasintellectualpropertyrightsrelatingtotechnologyembodied
intheproductdescribedinthisdocument.Inparticular,andwithout
limitation,theseintellectualpropertyrightsmayincludeoneormore
ofthepatentslistedatwww.axis.com/patent.htmandoneormore
additionalpatentsorpendingpatentapplicationsintheUSandother
countries.
LegalConsiderations
Videoandaudiosurveillancecanberegulatedbylawsthatvaryfrom
countrytocountry.Checkthelawsinyourlocalregionbeforeusing
thisproductforsurveillancepurposes.
Liability
Everycarehasbeentakeninthepreparationofthisdocument.Please
informyourlocalAxisofceofanyinaccuraciesoromissions.Axis
CommunicationsABcannotbeheldresponsibleforanytechnicalor
typographicalerrorsandreservestherighttomakechangestothe
productandmanualswithoutpriornotice.AxisCommunicationsAB
makesnowarrantyofanykindwithregardtothematerialcontained
withinthisdocument,including,butnotlimitedto,theimplied
warrantiesofmerchantabilityandtnessforaparticularpurpose.Axis
CommunicationsABshallnotbeliablenorresponsibleforincidentalor
consequentialdamagesinconnectionwiththefurnishing,performance
oruseofthismaterial.Thisproductisonlytobeusedforitsintended
purpose.
TrademarkAcknowledgments
AXISCOMMUNICATIONS,AXIS,ETRAX,ARTPECandVAPIXare
registeredtrademarksortrademarkapplicationsofAxisABinvarious
jurisdictions.Allothercompanynamesandproductsaretrademarksor
registeredtrademarksoftheirrespectivecompanies.
Acrobat,Adobe,Apache,Debian,Ethernet,InternetExplorer,Iomega,
LaCie,Linux,Mac,Macintosh,Microsoft,Mozilla,MySQL,RedHat,
UNIX,Windows,WWW,Wi-Fiareregisteredtrademarksofthe
respectiveholders.JavaandallJava-basedtrademarksandlogosare
trademarksorregisteredtrademarksofOracleand/oritsafliates.
UPnPTMisacerticationmarkoftheUPnPTMImplementersCorporation.
WPAisamarkoftheWi-FiAlliance.
Support
Shouldyourequireanytechnicalassistance,pleasecontactappropriate
channelsaccordingtoyourAVHSlicenseagreementtoensurearapid
response.

GettingStarted–Ubuntu
TableofContents
1Introduction..............................................4
1.1Systemcomponents..........................................4
1.2Serverhardwarerequirementsandrecommendations...............4
1.3Softwarerequirementsandrecommendations.....................5
1.4Ports.......................................................6
1.5Networksetup...............................................7
1.6CongureHAProxy...........................................7
2Systemsetup.............................................8
2.1Preparations................................................8
2.2Fetchrequiredles...........................................8
2.3Unpacktheles.............................................8
2.4Congurelogrotation........................................9
2.5Installotherrequiredapplications...............................9
2.6InstallandbuildGStreamer....................................11
2.7CongureApache............................................11
3SetuptheAVHSportal....................................13
3.1EdittheAVHScongurationle................................13
3.2Runthesetupscripts.........................................13
3.3Systemstartup..............................................14
4Addingdevicestothesystem................................17
4.1Connectandregisterproductswithrmware5.xx..................17
4.2Upgradearmware4.xxproduct................................18
4.3Connectandregisterupgradedproducts..........................18
4.4NoDHCPserver?.............................................19
5Congurethesystem......................................2
5.1Dispatcherconguration......................................2
5.2Periodicroutines.............................................2
Troubleshooting...........................................21
6.1StatusLEDerrorindications....................................21
6.2TroubleshootingFAQ..........................................21
6.3Resettingtofactorydefault—Axisproducts......................23
7What’snext?.............................................25
7.1Providerstatus..............................................25
7.2Optionalextracomponents....................................25

GettingStarted–Ubuntu
1Introduction
1Introduction
Thisdocument,intendedforvideohostingproviders,describeshowtoinstall,congureandgetstartedwithAXISVideoHosting
System(AVHS).ThisdocumentisintendedforAVHSinstallationon4-bitUbuntuserver14.04LTS.ForinstallationonRedHat
EnterpriseLinux,refertothedocumentGettingStarted—RedHat.
MoreinformationontheAVHSsystemcanbefoundontheAVHSwebsiteavailablefromthePartnerPagesonwww.axis.com/partner
1.1Systemcomponents
ThemaincomponentsintheAVHSsystemare:
AVHSportal-Providesafront-end(GUI)forend-usersandadministratorsandaback-endimplementingthesystembusinesslogic
(videomanagement,usernotication,externalinterfaces,etc).Allcommunicationbetweenauserandthesystemgoesthrough
thismodule.
STserver-Asoftwarecomponentrunningononeormoreservers.TheSTserverhandlescommunicationswithnetworkdevices
(clients).TheSTserverisaccessedbyotherpartsofthesystem,neverdirectlybyauser.
STclient-AsoftwarecomponentinthenetworkdevicermwarethatcommunicateswiththeSTserver.
Database-SQLdatabasethatstoresallshareddataintheAVHSsystem.
Mediaservers-UsedforRTMP/RTSP/RTPH.264/MPEG-4mediadistribution.Italsohandlesmanualandscheduledrecordings.
Storage-Asubsystemprovidinglestorageformediageneratedinthesystem.
WebSocketserver-OneormoreserversenablingAVHStopushinformationtoawebpage.Forguaranteedcompliancewithproxy
andrewalls,websocketserversshouldlistentostandardwebports(8/443),inthatcasetheyneedtorunonaseparateIP,or
behindaloadbalancerthatiscapableofredirectingwebsockettrafc.
HAProxyBalancer-Areverseproxylisteningontheinterfacehandlingthemainwebaccessdomainwww.example.com.The
balancerisresponsiblefordistributingtheloadontothedifferentAVHSportalsandWebSocketservers.
HAProxyServiceRouter-Areverseproxyconguredtoallowmultipleservicestobeservedfromthesameports.Theportrouteris
capableofsharingAPI,web,WebSocket,o3c-proxyandEvoStreammediaserverrequestonport8and443.
1.2Serverhardwarerequirementsandrecommendations
Hardwarerequirementsdependonthenumberofdevicesandusersandthefunctionalitytosupport.Smallersystemsmayrunon1-3
servers,whereaslargerinstallationsmayrequirededicatedserversforstorage,databases,etc.NotethattheAVHSsystemdoesnot
dependgreatlyonprocessorspeed–theamountofavailableRAMismuchmoreimportant.
1.2.1Exampletestsystem
Foraninitialtestsystemwithalimitednumberofdevices(<5)thehardwarespecicationisnotcritical,amoderndesktopPCwill
sufce.Therecommendedminimumhardwaresystemrequirementsforatestsystemareasfollows:
•Pentium4,2GHzprocessor
•1GBRAM
•Harddiskwith1GBormoreavailablestoragespace
•1MbitEthernet
4

GettingStarted–Ubuntu
1Introduction
1.2.2Exampleproductionsystem(basic)
Givinganaccurateforecastofhowmanydevicescanbeusedonwhichhardwareisalmostimpossible-therearetoomany
parameterstomakethisfeasible.Specifyingamaximumnumberofdevicesthatcanbeconnectedtothesystemisnotalwaysvery
useful.Aslongasthereisnocamera/useractivity,thentheloadplacedonthesystembyeachindividualconnectionisverysmall.
Itisinsteadtheactivitiesallowedtoyourusersthatplacetheloadonthesystem.Theactivitiesthatrequirethemostresourcesare
liveviewingandcontinuousrecording.Also,thegreatertheframeratesandresolutionsyouallowyourusers,thegreatertheloadon
thesystem.So,foranexamplesystemofapproximately1connecteddevices,youshouldbeabletosupportthefollowing:
•AlldevicescontinuouslyuploadingH.264recordingsatabitrateof1kbps.
•H.264eventuploadsfrom8devices.Alarmsaresentafterevery3minutes,eachalarmis1secondslongand
hasa64x48resolution.
•Allstoredvideoisautomaticallydeletedafter168hours(1week).
Therecommendedcongurationforthisexamplesetupis3physicalserversand15virtualservers,eachwithdirectlyconnected
storagethatcanhandleupto3Input/Outputoperationspersecond(3IOPS).Thisshouldgivesufcientheadroomfor
initialcapacitypeaksandallowforexpansionwhengreaternumbersofuserssignupfortheservice.Thecongurationofeach
servercanbee.g.:
•2xIntelXeon3.GHzprocessors,orbetter
•5GBlocalharddrive,orbetter
•Minimum3.5GBmemory
•2x(redundant)HostBusAdapters,foraconnectiontotheSAN(StorageAreaNetwork)
•2GigabitEthernetconnection,foraconnectiontotheNFS(NetworkFileSystem)
Note
•Forlargerinstallations,NAS(NetworkAttachedStorage),SAN(StorageAreaNetwork)orNFS(NetworkFileSystem)is
recommended.Thesesolutionsaremoreexpensivebutprovidemuchbetterscalability.
•Thebestwaytocometousefulconclusionsonwhichhardwaretouseistostartsmallandthenscaleoutasrequired.
1.Softwarerequirementsandrecommendations
TheAVHSportalandthisguideisintendedforuseonaUbuntuserver14.04LTSoperatingsystemwith4-bitsupport.Axishas
testedtheUbuntuLinuxdistributionandRedHatEnterpriseLinux,whichareallknowntoworkwellwiththeAVHSapplication.
AnyadministrativechangesrequiredforyourpreferredLinuxsystemareyourownresponsibility–thesearenotdocumented
norrecommendedbyAxis.
ToinstallthecompleteAVHSportalonUbuntuLinuxyouneed:
•AVHSdistributionle—availablefromthePartnerPageswebsite.
•Apache2(mpm-prefork)withSSLsupport
•SQLdatabase—AxisrecommendsMySQL.MySQLCommunityServer,standardedition,workswellwiththeAVHSportal.
•PHP5withthefollowingrequirements:
-PHP5mustbeintegratedwithApache2
-PHP5mustincludesupportforMySQL,OpenSSL,cURL,ZLIB,mcrypt,GDwithlibjpegandlibpng,pcntlandsocket.
•Synchronizedtimeonallsystemsinvolved,preferablyviaNTP
5

GettingStarted–Ubuntu
1Introduction
1.4Ports
ThetablebelowlistsalltheportsusedbyvariousapplicationsintheAVHSsystemandcanbeusedtosetIPltersinthesystem.
Notethat,theportsshownhereareexamplevaluesonly.
8/home/sts/web/interfacesdirectoryforthecameras(eventuploadsandsimilar.)
443webinterfaceforusersandforeventsuploadsto/home/sts/web/interfacesdirectory.
88devices—>STserver(forcameraconnections)
554mediaserver(RTSPforstreamingH.264andMPEG-4)
1935mediaserver(RTMPforstreamingH.264andMPEG-4)
Important
Therequirementisthat,theserverneedstohaveInternetaccessduringsetupandproduction,eitherdirectlyorthrough
aHTTP-proxy.ProxysettingscanalsobeaddedthroughtheHTTP_PROXYparameterinAVHSportal>SystemConguration.
Forcorrectcongurationofscheduledrecordingsandmotiondetection,proxymustbeaddedfordeviceswithrmware
5.4.xx.
SourceportSourceapplicationDestinationportDestinationapplicationProtocol
AnyCamera8/443/881DispatcherTCP
AnyWebserver443DispatcherTCP
AnyEnduser8/443WebserverTCP
AnyCamera8WebserverTCP
AnySTserver8WebserverTCP
AnyWebserver8InternetWSDL’sTCP
AnyWebserver336SQLserverTCP
AnyCamera88STserverTCP
AnyWebserver88STserverTCP
AnyMediaserver88STserverTCP
AnyWebserver1554MediaserverTCP
AnyEnduser554/1935MediaserverTCP
AnyNTPclient123NTPserverUDP
AnyNTPserver123NTPclientUDP
AnyEnduser4WebsocketserverTCP
AnyWebserver41WebsocketserverTCP
AnyEnduser843WebsocketserverTCP
AnyEnduser4443WebsocketserverTCP
1.Dispatcherdestinationport88isapplicableforrmwareearlierthan5.4only.
1.4.1Otherportrequirements
Howthesystemstoragewillbeaccesseddependsonthemethodused:NAS,SANorDAS.
TheuseofDASrequiresNFS,formountingthestorageonallservers.Inthiscase,portsforNFSmustalsobeopenedinthesystem.
NAS=NetworkAttachedStorage
6

GettingStarted–Ubuntu
1Introduction
SAN=StorageAreaNetwork
DAS=DirectAttachedStorage
NFS=NetworkFileSystem
1.5Networksetup
TheAVHSsystemisdesignedforuseonTCP/IPnetworks.ThestandardrecommendedsystemsetupusespublicIPaddressesforthe
STservers.InstallationisalsopossiblebehindaNATrouter.
1.6CongureHAProxy
ThisguidedoesnotincludeaninstructionforsettingupHAProxybalancerandservicerouter.ExamplesforconguringHAProxycan
befoundintheAVHSdistributionleundertheexamplesdirectory.Thehaproxy-service-router-example.conflecontainsrulesfor
theservicerouterandthehaproxy-balancer-example.confcontainsrulesforthebalancer.
Important
Aproductionsystemrequiresboththebalancerandserviceroutertobefullyfunctional.
Iftheservicerouterismissingthefollowingfeatureswillnotworkforallclients.
•ThedeviceproxyAPI(proxy_urlwillwork,urlwillnot)
•TheAccessdevicelinkintheclassicGUI.
Iftheservicerouterismissingthefollowingfeatureswillnotworkforclientsbehindacorporateproxyorrewall.
•RTSPLiveandplaybackfromSD-cardorEdge-storage.
•RTMPLiveandplaybackfromSD-cardorEdge-storage.
•HTTP(MJPEG)Live.
•ServerreportsfromtheadminGUI.
•Twowayaudio.
•PTZjoystickfromthenewGUI.
•MotiondetectionpreviewimageintheclassicGUI.
•ImagepreviewforAXISCameraApplicationPlatform(ACAP)congurationintheclassicGUI.
7

GettingStarted–Ubuntu
2Systemsetup
2Systemsetup
ThischapterprovidesinstructionsforinstallationandcongurationoftheapplicationsrequiredbytheAVHSportal.
TheprocessdescribedbelowisforinstallationonUbuntuServer14.04LTS.
Thisinstallationwasperformedona"clean"x86_64machine,thatistheinstallationwasstartedbyinstallingtheUbuntuoperating
system,whichisavailablefromwww.ubuntu.com
2.1Preparations
2.1.1Prerequisites
Tofollowtheinstructionsinthischapter,thefollowingisrequired:
•AninstalledLinux/Unixdistribution.Here,UbuntuServer14.4LTSisused.
•AccesstotheInternet,includingproxysettingsifrequired.
•Acorrectlyconguredsourceslistforinstallingpackages.
2.1.2Commands
Mostofthecommandsinthisdocumentshouldberunasroot,althoughthereareafewexceptions.Thefollowingconventionsapply:
#=runthisasuserroot
%=runthisasusersts(orequivalent)
##=showsoutputorcomments
2.1.Createusersts(orequivalent)andthehomedirectory
CreateauserfortheAVHSsystem:
#useraddsts-d/home/sts-m
#passwdsts
##EnternewUNIXpassword:
##RetypenewUNIXpassword:
##passwd:passwordupdatedsuccessfully
2.2Fetchrequiredles
TheAVHSportalinstallationlesareavailablefromtheAVHSwebpage(loginfromwww.axis.com/partner).Astheusersts,place
thelesin/home/sts.Thelerequiredforthisinstallationis
avhs-3.0.0-ubuntu-trusty-
x86_64.tar.gzTheAVHSportaldistribution.
2.Unpacktheles
UnpacktheAVHSportalinstallationleasusersts(orequivalent):
#su-sts
%cd/home/sts/
%tarxzfavhs-3.0.0-ubuntu-trusty-x86_64.tar.gz
Createasymboliclinktothedirectory.Thismustberunasusersts:
8

GettingStarted–Ubuntu
2Systemsetup
%ln-snavhs-3.0.0-ubuntu-trusty-x86_64current
%exit
2.4Congurelogrotation
Copythesamplelogrotationleandeditifrequired:
#cd/home/sts/current/examples/
#cplogrotate-sts/etc/logrotate.d/
Note
•WhentheAVHSdistributionleisunpacked,thedefaultlogdirectoryforstsisautomaticallycreated,as
/home/sts/current/logs/.Iflogsshouldbestoredinanotherdirectory,thismustbeconguredmanually,
forexample:
#mkdir-p/var/log/sts/
#chown-Rsts:sts/var/log/sts
•Whenstoringlogsinotherlocations,remembertochangethepathinthelogrotate-stsle.
•Wherevertheloglesarestored,alwaysensurethereisenoughdiskspacetoholdthem.Inlargersystems,itis
recommendedtouseaseparatepartitionforlogles.
2.5Installotherrequiredapplications
Theinstructionsprovidedhererelyontheinstallationofspecicversionsofvariousapplicationsandsystems;MySQL,Apache2,
PHP5,etc.Followingtheseinstructionswillensurethecorrectversionsareinstalled.
TheinstructionsprovidedbelowapplytoUbuntu.
2.5.1InstallMySQL
InstalltherequiredMySQLcomponentsandsetthepassword.
#apt-getinstallmysql-clientmysql-servermysql-common
2.5.2InstalltheApachewebserver
InstallApache2:
#apt-getinstallapache2-mpm-prefork
2.5.InstallPHP
ToinstallPHP5:
#apt-getinstallphp5php5-mysqlphp5-curlphp5-gdphp5-mcryptphp5-cliphp5-apcu
Editthefollowinglesasroot:
#vi/etc/php5/apache2/php.ini
#vi/etc/php5/cli/php.ini
#vi/etc/php5/mods-available/apcu.ini
#vi/etc/php5/mods-available/opcache.ini
tomatchthevaluesintheexamplele/home/sts/current/examples/php_directives.ini
2.5.4Recongurelocales
IfinstallingAVHSonanoperatingsystemwhosedefaultlanguageisnotUSEnglish(en_US),thelocalesshouldberecongured.
9

GettingStarted–Ubuntu
2Systemsetup
Firsteditthele/var/lib/locales/supported.d/localtoincludetheneededlocales.Acompletelistofsupported
localescanbefoundinthele/usr/share/i18n/SUPPORTED.
DefaultlanguageforAVHSisUSEnglish;theinstallationpackagealsoincludesaSwedishtranslation.Includethesetwolocales,i.e.
en_USISO-8859-1andsv_SEISO-8859-1inthelocalesle.Includeadditionallocalesasneeded.
Aftereditingthele,run
#dpkg-reconfigurelocales
DefaultlanguageforAVHSisUSEnglish;theinstallationpackagealsoincludesaSwedishtranslation.Selecttheselocales,en_US
ISO-8859-1,en_USUTF8andsv_SEISO-8859-1.Selectadditionallocalesasneeded.
2.5.5InstallandcongureSSL
AVHSrequiresOpenSSLandnotsimplythelibssllibrary.Notethat,OpenSSLhasalreadybeeninstalledwhenyouinstalled
PHP5asdescribedin2.5.3InstallPHPonpage9.
#a2enmodssl
Edittheports.confletoincludetheportsbelow.
Note
MakesuretoverifythatListen80andListen443arenotusedanywhereelseintheports.conflebefore
addingitthroughthisstep.
#vi/etc/apache2/ports.conf
Listen80
Listen443
Commenttheline:
NameVirtualHost*:80
to
#NameVirtualHost*:80
Example:
#NameVirtualHost*:80
Listen80
<IfModulessl_module>
Listen443
</IfModule>
<IfModulemod_gnutls.c>
Listen443
</IfModule>
2.5.6SetupSSLcerticates
Usetheprovidedscripttocreateaself-signedcerticate.TheCommonNamemustbethesameastheDNSnameofyourhost.
Thismustberunasusersts:
#su-sts
%cd/home/sts/current/bin/
%./generate_self_signed_certificate.sh
Createthedirectoryforthecerticateles(server.keyandserver.pem)andcopythemthere.Itisrecommendedtousea
directorythatisnotversion-specic.Thismustberunasusersts:
%mkdir/home/sts/etc/ssl
10

GettingStarted–Ubuntu
2Systemsetup
%mvserver.*/home/sts/etc/ssl/
%exit
2.6InstallandbuildGStreamer
GStreamerisneededtoconvertmedialesbetweendifferentformatsintheAVHSsystem.
Note
•Downloadofbuilddependenciesrequiresapproximately6MBonsystemdisks(var).
•SourceandbuildoftheGStreamerapplicationrequires846MBunder/home/sts/gst/.Youwillbeaskedifyouwant
toremovesourceandbuilddata.
•Thenalapplicationwilltake157MBunder/home/sts/gst/
RunthefollowingcommandstoinstallprerequisitesandbuildGStreamer.Thisproceduremighttakeawhile.
#apt-getinstallbuild-essentialzlib1g-devgettextbisonflexpkg-configautopoint
#apt-getinstallintltoollibxml2-devpythonzlib1glibxml2libjpeg8liboil0.3
#apt-getinstalllibjpeg8-devliboil0.3-devlibffi-devlibpng12-devlibsqlite3-dev
#apt-getinstalllibpng12-0yasmbzip2zlibclibglib2.0-0libglib2.0-dev
#su-sts
%mkdir/home/sts/gst
%cd/home/sts/gst/
%cp-av/home/sts/current/examples/gst-install.sh.
%./gst-install.sh
%exit
2.7CongureApache
EditthedefaultenvironmentvariablesforApache:
#vi/etc/apache2/envvars
Changeuserstosts:
exportAPACHE_RUN_USER=sts
exportAPACHE_RUN_GROUP=sts
Changeownershipoflockletomatchrunuser
#chownsts:sts/var/lock/apache2
EditthemainApacheservercongurationle:
#vi/etc/apache2/apache2.conf
Tohandle.cgilesasscripts,add:
AddHandlercgi-script.cgi
Toincludevirtualhosts,makesurethatthefollowinglinesareincluded:
#Includevirtualhostconfigurations:
Includesites-enabled/
ToenableausefultoolfordiagnosingproblemsinApache,includethefollowinglines:
<IfModulemod_status.c>
#
#Allowserverstatusreportsgeneratedbymod-status,
#withtheURLofhttp://servername/server-status
#
11

GettingStarted–Ubuntu
2Systemsetup
<Location/server-status>
SetHandlerserver-status
Orderdeny,allow
Denyfromall
Allowfrom127.0.0.1
</Location>
</IfModule>
Important
ItisrecommendedtoconsiderthedirectivesServerTokensandServerSignatureandsetvaluessuitableforyoursetup.
12

GettingStarted–Ubuntu
SetuptheA VHSportal
SetuptheA VHSportal
Havinginstalledandconguredallrequiredapplications(see2Systemsetuponpage8),itisnowtimetosetuptheAVHSportal.
TheAVHSportaldistributionpackageincludestheAVHScongurationleandsetupscripts.Thesewillgenerateadatabase,web
servers,STserversandmediaservers.Tosetuptheportalandstartthesystem,followthesesteps:
1.Editthecongurationleavhs_config.ini
2.Runthesetupscripts
3.Copythestartupscriptstothelaunchdaemondirectoryandlinkthemtothecorrectrunlevel
4.Startthesystem
AdditionalSTservers,webserversandmediaserverscanbeaddedatanytimebyrstaddinganewentrytotheconguration
leandthenrunningtherelevantsetupscript.
.1EdittheAVHScongurationle
Thecongurationleavhs_config.inishouldbeeditedbeforerunningthesetupscripts:
#su–sts
%vi/home/sts/current/setup/avhs_config.ini
Note
TheAVHSsystemcanalsobesetupbehindaNAT.
RTMPTforwardingservicemustbeconguredforthewebsocketservertostart.HowtocongureRTMPTforwarding
isbeyondthescopeofthisguide.
Whennishededitingthele,run
%exit
#php/home/sts/current/setup/config_test.php
totestandcheckforsyntaxerrors.
.2Runthesetupscripts
Thefollowingsetupscriptsareavailablein/home/sts/current/setup/
setup_db.phpDatabasesetup
setup_websocketserver.phpWebsocketserversetup
setup_webserver.phpWebserversetup
setup_stserver.phpSTserversetup
setup_mediaserver.phpMediaserversetup
setup_sthelpers.phpSThelperssetup
Allsetupscriptsshouldberunasusersts:
#su-sts
%cd/home/sts/current/setup/
1

GettingStarted–Ubuntu
SetuptheA VHSportal
Important
•Thedatabasesetupscriptsetup_db.phpnishesbydisplayingthepasswordfortheMASTERADMINaccount.Don’t
forgettomakeanoteofthispassword!
•TheSTserversetupscriptsetup_stserver.phpwillgenerateaCerticateAuthority(CA),unlessaCAhasbeen
conguredearlier.EnterapassphrasefortheCAwhenprompted.Thesetup_stserver.phpscriptwillalsogeneratea
CA-signedcerticatefortheSTserver.EntertheCApassphrasewhenprompted.
•Thesetupscriptsmaypromptforuseraction,pleaseignorethemessages.
Runthesetupscriptsinthefollowingorder:
%phpsetup_db.php
%phpsetup_websocketserver.php
%phpsetup_webserver.php
%phpsetup_stserver.php
%phpsetup_mediaserver.php
%phpsetup_sthelpers.php
%exit
.Systemstartup
..1Startthewebserver
Copythelewebserver1-virtualhosttoyourApachevirtualhostfolder
#cd/home/sts/current/setup/
#cpwebserver1-virtualhost.conf/etc/apache2/sites-available
Note
IftheWebAppandtheAPIarehostedonadifferentdomains,Cross-siteHTTPrequests(CORS)mustbeenabledbytheserver
hostingtheAPIinthecongurationlewebserver1-virtualhost.conf.
EnableandrestartApache:
#a2enmodrewrite
#a2enmodheaders
#a2enmodexpires
#a2enmodcgi
#a2dissite000-default.conf
#a2ensitewebserver1-virtualhost.conf
#serviceapache2restart
Tocheckthattheinterfaceisreachable,enterthefollowingURLinabrowser(rememberthatthisisHTTPS!):
https://<your-host-name>/admin/test.php
Note
TheSTservershavenotbeenstartedandarethereforenotreachableyet.Thepagemaytakesometimetoload.
..2SThelpers
NotethatSTHelperswillautomaticallystarttheServerWatchdogandAlarmCloser.
14

GettingStarted–Ubuntu
SetuptheA VHSportal
ServerWatchdogbin/server_watchdog.phpChecksthattheservers(webserver,STserverandmediaserver)
areupandrunning.
Todetermineifaserverisavailableornot,anHTTPrequest
issenttotheserver.Thedatabaseisupdatedaccordingto
whethertheserverrespondstotherequestornot.Thedatabase
isupdatedduringeachtesttosetthetimewhentheserver
waslasttested.
Runthescriptoneveryserverinthesystem.Oneinstanceof
thescriptwillnevertestthesameserveratthesametimeon
amultiportalsystem.
AlarmCloserbin/alarm_closer.phpChecksforrecentlystoppedJPEGandedgestoragealarms,
updatesthecorrespondingeventsandsendsWebSocket
notications.ThisserviceisneededforJPEGalarmsbecause
devicessuchascamerasdonotexplicitlyreportwhenalarms
end.Fortheedgestoragealarms,thisserviceisneededbecause
camerasdonotreportwhenedgestoragealarmsend.Make
surethatatleastoneinstanceofthisscriptrunsatanygiven
timeotherwiseJPEGalarmsandedgestoragealarmswillnot
behandledproperly.
Copythestartupscriptto/etc/init.d/andlinkittoyoursystem’sdefaultrunlevel:
#cd/etc/init.d/
#cp/home/sts/current/setup/sthelpers.
#update-rc.dsthelpersdefaults90
TostarttheSThelpers:
#servicesthelpersstart
..StarttheWebsocketserver
Copythewebsocketserverstartupscriptto/etc/init.d/andlinkittothesystem’sdefaultrunlevel:
#cd/etc/init.d/
#cp/home/sts/current/setup/wssd_websocketserver1.
#update-rc.dwssd_websocketserver1defaults90
Tostartthewebsocketserver:
#servicewssd_websocketserver1start
Note
TheWebGUIwillshowanerrormessageandauto-logoutifthecommunicationwiththeWebSocketserverfails.
Thismaybeduetocerticateorconnectionerrors.Verifyconnectivitythroughthewebbrowserbygoingto
https://<websocketserver_address>:<websocketserver_ssl_port>/socket.io/
..4StarttheSTserver
TheSTserverwillusuallybestartedatboottime.TheSTserversetupscriptautomaticallycreatesascriptthatcanbeusedtodo
this.Copythescriptsto/etc/init.d/ifyouareusinganSysVstyleinitsystemandlinkittothecorrectrunlevel.Thescripts
shouldbestartedafterallnetworkservicesarecongured.
#cd/etc/init.d/
#cp/home/sts/current/setup/stsd_stserver1.
#update-rc.dstsd_stserver1defaults90
TostarttheSTservers:
#servicestsd_stserver1start
15

GettingStarted–Ubuntu
SetuptheA VHSportal
Note
TheSTservershouldbestartedafterthewebserver,sincetheSTserverusesthewebserverforregistration.
..5Startthemediaservers
Copythemediaproxystartupscriptto/etc/init.d/andlinkittothesystem’sdefaultrunlevel:
#cd/etc/init.d/
#cp/home/sts/current/setup/mediaserver_mediaproxy1.
#cp/home/sts/current/setup/mediaserver_evostream1.
#update-rc.dmediaserver_mediaproxy1defaults90
#update-rc.dmediaserver_evostream1defaults90
Tostartthemediaserver:
#servicemediaserver_mediaproxy1start
#servicemediaserver_evostream1start
..6Verifyinstallation
TheAVHSinstallationisnowcomplete.Devicesandusersshouldbeabletoconnect.
Openthetestpagetoviewbasicinformationabouttheinstallation:
https://<your-host-name>/admin/test.php
Note
•Themediaserverusesalotofopenledescriptors.Checkyouruser’slimitonledescriptorsandthehighestvalueinthe
Linuxkernel.Thedefaultvalueinthemediaserver_<mediaproxy_id>daemonis1.Ifyouneedmore,change
thevalueoftheFILESvariableandcontacttheAVHSHelpdesktoobtainanewmediaserverbinaryle.
•Thenumberofallowedledescriptorscanbecheckedbyrunningulimit-n.
16

GettingStarted–Ubuntu
4Addingdevicestothesystem
4Addingdevicestothesystem
ThefollowingdevicescanbeaddedtotheAVHSsystem:
•NetworkcamerasandvideoencoderswithAVHSrmware:
-Productswithrmware5.xxoftenhavebuilt-inAVHSsupportwithOne-ClickCameraConnection,see4.1
Connectanregisterprouctswithrmware5.xx
-Productswithrmware4.xxcanbeupgradedwithAVHSrmware,see4.2Upgraearmware4.xxprouct
•NetworkAttachedStoragedeviceswithAVHSsupport
Inthisdocumentandintheadministratorinterface,cameras,videoencodersandstoragedevicesarereferredtocollectively
as“devices”exceptwhereotherwiseindicated.
WhenadevicecontainingAVHSrmwareisconnectedtotheInternetitwillrstconnecttoadispatcher,whichisaservice
maintainedbyAxisCommunicationsAB.WhenregisteringthedeviceattheAVHSportal,theportalcontactsthedispatcherandasks
forthedevice.IftheOAK(seebelow)isvalidforthespecieddevice,andiftheAVHSportalisatrustedserviceprovider,thedevice
willbereconguredtoconnectdirectlytothatserviceprovider’ssystem.
ToregisteradeviceintheAVHSsystemyouneed:
•Thedevice’sserialnumber,whichcanbefoundontheproductlabel.
•Thedevice’sOwnerAuthenticationKey(OAK).IftheOAKisnotincludedinthepackageyoucanobtainanOAKfrom
theAVHSHelpdesk.
4.1Connectandregisterproductswithrmware5.xx
SeveralofAxisnetworkcamerasandvideoencoderswithrmware5.xxhavebuilt-inAVHSsupportwithOne-ClickCamera
Connection.Checkthetechnicalspecications(foundintheproduct’sdatasheetorUser’sManual)toseeiftheproductincludes
AVHSsupport.
ToconnectandregisteranAxisproductwithAVHSsupport,followthesesteps:
1.ConnecttheproducttotheInternet.
2.Pressandholdproduct’scontrolbuttonuntiltheStatusLEDindicatorashesgreen.Whentheproducthasbeenassigned
aDHCPIPaddressandsuccessfullycontactedthedispatcher,theStatusLEDwillashambertwice.Foralistoferror
indications,see6.1StatusLEDerrorinicationsonpage21.
3.RegistertheproductattheAVHSportal.Theproduct’sserialnumberandOwnerAuthenticationKeyarerequired.The
productcanberegisteredintwodifferentways:
-Fromtheuserportalhttps://<your-host-name>.Toregisteraproduct,theuseroradministrator
mustrstcreateauseraccount.
-Fromtheadministratorinterfacehttps://<your-host-name>/admin.Loginusingthe
MASTERADMINaccountandthepasswordthatwasgeneratedwhenrunningthedatabasesetupscript,see
page13.Inthiscasetheproductisaddedtothesystemandcanlaterbeassignedtoanyexistinguseraccount.
4.Liveimagesfromtheproductshouldbeavailablewithinafewseconds.
Note
TheproductmustberegisteredattheAVHSservicewithin24hoursofpressingthebutton.
17

GettingStarted–Ubuntu
4Addingdevicestothesystem
4.2Upgradearmware4.xxproduct
Axisproductswithrmware4.xxmustbeupgradedwithAVHSrmwarebeforetheycanbeaddedtotheAVHSsystem.Notethat
AVHSrmwareisnotavailableforallmodels,refertotheAVHSwebpageformoreinformation.
Important
AfterupgradingtoanAVHSrmware,theproductmustberesettofactorydefault.Someproductparameterswillretain
theirpreviousvaluesevenaftertheupgrade;byresettingtheproducttofactorydefault,allproductparameterswillreceive
theirnewAVHSvalues.
ToupgradeanAxisproduct,followthesesteps:
1.DownloadtheappropriatermwarelefromtheAVHSwebpage.
2.Opentheproduct’swebpagesinabrowser.GototheSetup>SystemOptions>Maintenancepage.
3.UnderUpgradeServer,browsetothenewrmwareleandclickUpgrade.Theproductwillrestartautomaticallyafterthe
upgradehasbeencompleted(1–1minutes).
4.Resettheproducttofactorydefault:Firstdisconnectpower.Thenpressandholdthecontrolbuttonwhilereconnecting
power.KeepthebuttonpresseduntiltheStatusLEDindicatorashesamber.Releasethecontrolbutton.WhentheStatus
indicatordisplaysgreen(whichcantakeuptooneminute)theprocessiscompleteandtheproducthasbeenreset.See
also6.3Resettingtofactoryefault—Axisprouctsonpage23.
Note
Refertothedocumentationsuppliedwithyourproductformoreinformationaboutresettingtofactorydefault.
AnAxisproductupgradedwithAVHSrmwareprovidesnodirectaccesstoliveimagesordevicesettings.Theproducthasarandom
rootpasswordandisonlyaccessiblethroughanAVHSportal.See4.3Connectanregisterupgraeprouctsforinstructionshowto
connecttheproducttotheportal.
4.2.1Examplermware
AlsoavailablefromtheAVHSwebpagearespecialrmwarelesknownasexamplermware.Theselesareintendedforlimited
testingonlyandshouldonlybeusedincaseswhereyouforexampleneedtotestonaclosednetworkandtheAxisproductcannot
connecttotheInternet.Thermwareavailablefordifferentmodelsislimitedandthereisnoguaranteethatexamplermwarewill
beavailableforfuturemodels.PleaserefertotheAVHSwebpageforfurtherinformation.
4.Connectandregisterupgradedproducts
Toconnectandregisterarmware4.xxdeviceupgradedwithAVHSfollowthesesteps:
1.ConnecttheproducttotheInternet.
2.Checkthattheproduct’sStatusLEDindicatorstopsashing.ThisindicatesthattheproducthasbeenassignedaDHCP
IPaddressandsuccessfullycontactedthedispatcher.Foralistoferrorindications,see6.1StatusLEDerrorinications
onpage21.
3.RegistertheproductattheAVHSportal.Theproduct’sserialnumberandOwnerAuthenticationKeyarerequired.The
productcanberegisteredintwodifferentways:
-Fromtheuserportalhttps://<your-host-name>.Toregisteraproduct,theuseroradministrator
mustrstcreateauseraccount.
-Fromtheadministratorinterfacehttps://<your-host-name>/admin.Loginusingthe
MASTERADMINaccountandthepasswordthatwasgeneratedwhenrunningthedatabasesetupscript,see
page13.Inthiscasetheproductisaddedtothesystemandcanlaterbeassignedtoanyexistinguseraccount.
4.Liveimagesfromtheproductshouldbeavailablewithinafewseconds.
18

GettingStarted–Ubuntu
4Addingdevicestothesystem
4.4NoDHCPserver?
IfnoDHCPserverisavailableonthelocalnetwork,thedevice’snetworksettingscanbeconguredfromthedevice’sdefaultindex
page.Dependingonthermwareversion,thedefaultindexpagecanbeaccessedafewminutesfromwhenthedevicewasstarted.
Todiscoverthedeviceonyourlocalnetwork,usee.g.broadcastpingandarp,ordownloadAXISIPUtilityfromwww.axis.com
Thedefaultindexpagealsoallowsviewingofthedevice’sServerreport,whichcanbeusefulfortroubleshooting.
19

GettingStarted–Ubuntu
5Configurethesystem
5Configurethesystem
5.1Dispatcherconguration
DeviceswithAVHSrmwareusesAxisdispatcherservicetoconnecttoyourAVHSsystem.Inordertotakecontrolofthedevices
belongingtoyoursystem,yourSTserversmustbeabletocontactthedispatcherservers.
IfyouhavebeengivenspecicinformationfromAxis,editthele
#vi/home/sts/current/config/dispatcher-conf.php
ChangetheselinestothevaluesprovidedbyAxis:
$provider_name=’demo’;//ProvidedbyAxis
$provider_password=’demopassword’;//ProvidedbyAxis
$provider_brandspec=’012345689’;//ProvidedbyAxis
Also,fortheSTserver,addtheprovider_nametothele
home/sts/current/etc/stserver_<stserver_id>.conf
Otherwise,thatis,ifyouhavenotbeengivenspecicinformationfromAxis,leavetheselinesastheyare.
TogetafaulttolerantsystemiftheDNSserversaredown,addthefollowinglinesto/etc/hosts:
87.237.210.63dispatcher.sts.axis.com
206.71.169.185dispatchus1.sts.axis.com
195.60.68.116dispatchse1.avhs.axis.com
195.60.68.117dispatchse2.avhs.axis.com
5.2Periodicroutines
5.2.1Quotacleanup
Thecurrent/bin/cleanup.phpscriptdeletesmediaevents(alarmsandrecordings)forusersthathaveexceededtheirstorage
quota.ThisscriptshouldpreferablyberunonceperminuteontheAVHShostasusersts.
Thecurrent/bin/time_cleanup.phpscriptgoesthroughallmediaevents(alarmsandrecordings)inthedatabaseand
comparestheeventsagetothetimesetfordeletingoldevents.ThisscriptshouldpreferablyberunonceperdayontheAVHShost
asusersts.
Sampleentryfor/etc/crontab(seethecrontab(5)manpage):
*****sts/usr/bin/php/home/sts/current/bin/cleanup.php>/dev/null
00***sts/usr/bin/php/home/sts/current/bin/time_cleanup.php>/dev/null
EnsurethatthepathtoPHPmatchesthepathwhereyourPHPisinstalled.
20
Table of contents
Other Axis Security Camera manuals

Axis
Axis AXIS 215 PTZ-E Instruction sheet

Axis
Axis AXIS M20 Series User manual

Axis
Axis Q6042-S User manual

Axis
Axis 225FD User manual

Axis
Axis P5514 PTZ User manual

Axis
Axis 211W User manual

Axis
Axis Q1659 User manual

Axis
Axis AXIS 209FD-R User manual

Axis
Axis Q6032-C User manual

Axis
Axis AXIS 207 User manual
Popular Security Camera manuals by other brands

TRENDnet
TRENDnet TV-IP110W - Wireless Internet Camera Server... Quick installation guide

SECO-LARM
SECO-LARM Enforcer EV-1186-N3GQ manual

LG
LG LVC-DV110HM operating instructions

Speco
Speco CVC-550EX Specification sheet

D-Link
D-Link MyDlink DCS-8515LH manual

Monacor
Monacor TVCCD-340COL operating instructions