HOME > EN > System Service
There are many ways to startup SRS:
srs/trunk/etc/init.d/srs
, and user can add to linux service when linked to the /etc/init.d/srs then add as service /sbin/chkconfig --add srs
.The SRS release binary can be downloaded from release site, we can install as system service, see: Github: release or Mirror for China: release
We donot need to add to linux service to directly start SRS:
cd srs/trunk &&
./etc/init.d/srs start
or
cd srs/trunk &&
./objs/srs -c conf/srs.conf
Install and startup SRS as linux system service:
trunk/etc/init.d/srs
to /etc/init.d/srs
Step1: Build and Install SRS
Intall SRS when build ok:
make && sudo make install
the install of make will install srs to the prefix dir, default to /usr/local/srs
, which is specified by configure, for instance, ./configure --prefix=`pwd`/_release
set the install dir to _release of current dir to use make install
without sudo.
Step2: Link script to init.d:
sudo ln -sf \
/usr/local/srs/etc/init.d/srs \
/etc/init.d/srs
Step3:Add as linux service:
#centos 6
sudo /sbin/chkconfig --add srs
or
#ubuntu12
sudo update-rc.d srs defaults
Get the status of SRS:
/etc/init.d/srs status
Start SRS:
/etc/init.d/srs start
Stop SRS:
/etc/init.d/srs stop
Restart SRS:
/etc/init.d/srs restart
Reload SRS:
/etc/init.d/srs reload
SRS will install api to /usr/local/srs
, which is specified by configure.
The api is the api-server of SRS, which is used for SRS to callback the http api. The http callback need to open the feature --with-http-callback
, and SRS use python(cherrypy) for server.py, which user can directly run.
The api-server tp provide http service, and the pages for demo of SRS including the player, encoder and the meeting demo of SRS. When api-server start, we can access http://192.168.1.170:8085
, the demo of SRS. See: Usage: Demo.
Step1: Enable the demo feature:
./configure --with-hls --with-ffmpeg --with-http-callback --with-ffmpeg
Step2: Install api:
make && sudo make install-api
Start api-server:
/usr/local/srs/etc/init.d/srs-api start
See: Usage: Demo
Step3: Link api script:
sudo ln -sf \
/usr/local/srs/etc/init.d/srs-api \
/etc/init.d/srs-api
Step4: Add to linux service:
#centos 6
sudo /sbin/chkconfig --add srs-api
or
#ubuntu12
sudo update-rc.d srs-api defaults
Step5: Manage the SRS-api service:
Get the SRS-api status:
/etc/init.d/srs-api status
Start SRS-api:
/etc/init.d/srs-api start
Stop SRS-api:
/etc/init.d/srs-api stop
Restart SRS-api:
/etc/init.d/srs-api restart
Winlin 2014.10
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。