Adult Script Pro Community Forums

Create, help and share your ideas with the community!

You are not logged in.

#1 2012-12-15 10:53:01

symtab
Administrator
Registered: 2010-08-23
Posts: 7,240
Website

[HOWTO] Configure Apache for pseudostreaming and hotlinking protection

Hi,

Small howto on configuring Apache for Pseudostreaming (using mod_flvx for FLV seeking and mod_h264_streaming) and Hotlinking Protection (using mod_auth_token). Installation needs to be done as root (via ssh access or any kind of console access).

This howto is for Red Hat based distributions (eg: RHEL and CentOS). If you are using cpanel please scroll down for WHM/Cpanel specific notes.

Downloading and installing mod_flvx:

wget -c https://github.com/osantana/mod_flvx/raw/master/mod_flvx.c
apxs -c -i ./mod_flvx.c
echo 'LoadModule flvx_module modules/mod_flvx.so' > /etc/httpd/conf.d/mod_flvx.conf
echo 'AddHandler flv-stream .flv' >> /etc/httpd/conf.d/mod_flvx.conf

Downloading and installing mod_h264_streaming:

wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz
tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz
cd mod_h264_streaming-2.2.7
./configure --with-apxs=/usr/bin/apxs
make
make install
echo 'LoadModule h264_streaming_module modules/mod_h264_streaming.so' > /etc/httpd/conf.d/mod_h264_streaming.conf
echo 'AddHandler h264-streaming.extensions .mp4' >> /etc/httpd/conf.d/mod_h264_streaming.conf

Downloading and installing mod_auth_token:

yum install libtool automake autoconf
wget -c http://mod-auth-token.googlecode.com/files/mod_auth_token-1.0.6-beta.tar.gz
tar -zxf mod_auth_token-1.0.6-beta.tar.gz
cd mod_auth_token
rm -f configure
autoreconf -fi
automake -f
./configure
make
make install
echo 'LoadModule auth_token_module modules/mod_auth_token.so' > /etc/httpd/conf.d/mod_auth_token.conf

Find the virtual host configuration for your domain (usually /etc/httpd/conf/httpd.conf) and the following lines:

	<Location /media/videos/flv/>
		AuthTokenSecret       "P4ss#w0rD"
  		AuthTokenPrefix       /media/videos/flv/
  		AuthTokenTimeout      7200
  		AuthTokenLimitByIp    on
	</Location>
	<Location /media/videos/mp4/>
		AuthTokenSecret       "P4ss#w0rD"
  		AuthTokenPrefix       /media/videos/mp4/
  		AuthTokenTimeout      7200
  		AuthTokenLimitByIp    on
	</Location>
	<Location /media/videos/mobile/>
		AuthTokenSecret       "P4ss#w0rD"
  		AuthTokenPrefix       /media/videos/mobile/
  		AuthTokenTimeout      7200
  		AuthTokenLimitByIp    on
	</Location>

Restart apache using:

service httpd restart

For WHM/cpanel servers, keep the below notes in mind:
1. apxs is usually located in /usr/local/apache/bin/apxs
2. Instead of using mod_flvx.conf, mod_h264_streaming.conf and mod_auth_token.conf you need to add all contents of these files to: /usr/local/apache/conf/includes/pre_virtualhost.conf (or something similar smile)).
3. You cannot add the mod_auth_token configuration in the main apache configuration (it will be overwritten on restart), so you need to use per user/virtualhost config. Read this: http://docs.cpanel.net/twiki/bin/view/E … nsideVHost
4. Apache needs to be restarted via: /usr/local/apache/bin/apachectl restart

Thats it!


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - PopAds

Offline

#2 2012-12-17 03:24:52

coderphp6
Member
Registered: 2011-04-20
Posts: 65

Re: [HOWTO] Configure Apache for pseudostreaming and hotlinking protection

thanks adrian

Offline

#3 2015-04-03 23:28:25

dereklro
Member
Registered: 2014-08-08
Posts: 37

Re: [HOWTO] Configure Apache for pseudostreaming and hotlinking protection

symtab wrote:

Find the virtual host configuration for your domain (usually /etc/httpd/conf/httpd.conf) and the following lines:

	<Location /media/videos/flv/>
		AuthTokenSecret       "P4ss#w0rD"
  		AuthTokenPrefix       /media/videos/flv/
  		AuthTokenTimeout      7200
  		AuthTokenLimitByIp    on
	</Location>
	<Location /media/videos/mp4/>
		AuthTokenSecret       "P4ss#w0rD"
  		AuthTokenPrefix       /media/videos/mp4/
  		AuthTokenTimeout      7200
  		AuthTokenLimitByIp    on
	</Location>
	<Location /media/videos/mobile/>
		AuthTokenSecret       "P4ss#w0rD"
  		AuthTokenPrefix       /media/videos/mobile/
  		AuthTokenTimeout      7200
  		AuthTokenLimitByIp    on
	</Location>

Do you mean "add the following lines"? If so, do I add them anywhere within the file?


logo.png

Offline

#4 2015-04-04 06:39:54

symtab
Administrator
Registered: 2010-08-23
Posts: 7,240
Website

Re: [HOWTO] Configure Apache for pseudostreaming and hotlinking protection

Yes, but these need to be in the virtual host configuration block.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - PopAds

Offline

Board footer

Powered by FluxBB