mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add nginx and used as http server
This commit is contained in:
parent
5841cfaf76
commit
57ea56970d
6 changed files with 39 additions and 6 deletions
24
trunk/configure
vendored
24
trunk/configure
vendored
|
@ -46,6 +46,28 @@ ret=$?; if [[ $ret -ne 0 ]]; then echo "build http-parser-2.1 failed, ret=$ret";
|
|||
if [[ ! -f ${GLOBAL_DIR_OBJS}/http-parser-2.1/http_parser.h ]]; then echo "build http-parser-2.1 failed"; exit -1; fi
|
||||
if [[ ! -f ${GLOBAL_DIR_OBJS}/http-parser-2.1/libhttp_parser.a ]]; then echo "build http-parser-2.1 failed"; exit -1; fi
|
||||
|
||||
# nginx for HLS, nginx-1.5.0
|
||||
if [[ -f ${GLOBAL_DIR_OBJS}/nginx-1.5.0/_release/sbin/nginx ]]; then
|
||||
echo "nginx-1.5.0 is ok.";
|
||||
else
|
||||
echo "build nginx-1.5.0";
|
||||
(
|
||||
rm -rf ${GLOBAL_DIR_OBJS}/nginx-1.5.0 && cd ${GLOBAL_DIR_OBJS} &&
|
||||
unzip -q ../3rdparty/nginx-1.5.0.zip && cd nginx-1.5.0 &&
|
||||
./configure --prefix=`pwd`/_release && make && make install &&
|
||||
ln -sf `pwd`/_release ../nginx
|
||||
)
|
||||
fi
|
||||
# check status
|
||||
ret=$?; if [[ $ret -ne 0 ]]; then echo "build nginx-1.5.0 failed, ret=$ret"; exit $ret; fi
|
||||
if [ ! -f ${GLOBAL_DIR_OBJS}/nginx-1.5.0/_release/sbin/nginx ]; then echo "build nginx-1.5.0 failed."; exit -1; fi
|
||||
|
||||
# use current user to config nginx,
|
||||
# srs will write ts/m3u8 file use current user,
|
||||
# nginx default use nobody, so cannot read the ts/m3u8 created by srs.
|
||||
cp ${GLOBAL_DIR_OBJS}/nginx/conf/nginx.conf ${GLOBAL_DIR_OBJS}/nginx/conf/nginx.conf.bk
|
||||
sed -i "s/^.user nobody;/user `whoami`;/g" ${GLOBAL_DIR_OBJS}/nginx/conf/nginx.conf
|
||||
|
||||
#####################################################################################
|
||||
# generate Makefile.
|
||||
#####################################################################################
|
||||
|
@ -141,3 +163,5 @@ echo 'configure ok! '
|
|||
echo "you can:"
|
||||
echo "\" make \" to build the srs(simple rtmp server)."
|
||||
echo "\" make help \" to get the usage of make"
|
||||
echo "\" sudo ./objs/nginx/sbin/nginx \" to start the nginx http server for hls"
|
||||
echo "\" ./objs/simple_rtmp_server -c conf/srs.conf \" to start the srs live server"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue