RealServer's commerce feature allows an administrator to restrict which users can access clips served by RealServer. When RealServer receives a request for secured content, it checks the list of authorized users to see whether the request is from someone who's allowed to receive it.
You don't need to add users to a list of authorized users one-by-one; this demonstration shows how you can use CGI and customized HTML files to allow users to register themselves via Web pages. Use the demonstration to see how RealServer can integrate with your Web server. Customize the files yourself to match your site's own needs.
Requirements for running the demonstration:
- Commerce Server Edition of RealServer G2
- Web Server running on the same host as RealServer G2
- Web Server configured to execute CGI programs
Steps to Set Up the Commerce Server PPV Demo
1. Copy sample media files
2. Copy sample CGI program and configuration file to your Web server
3. Copy sample HTML pages to your web server
4. Edit PPVDemo configuration file
5. Edit sample HTML pages
6. Browse to welcome.html and start registering!
1. Copy the Sample Media Files
Copy the supplied sample media files to a secure RealServer directory.
Copy: (RealServer main directory)/Commerce/media/sample1.rm
(RealServer main directory)/Commerce/media/sample2.rm
To: (RealServer main directory)/Secure
Note: PPVDemo can use any media files, as long as they are named "sample1.rm"
or "sample2.rm".
2. Copy the Sample CGI Program and Configuration File to Your Web Server
Copy the ppvdemo.exe program and ppvdemo.ini file to an appropriate CGI directory of the your Web server.
Copy: (RealServer main directory)/Commerce/bin/ppvdemo.exe
(RealServer main directory)/Commerce/bin/ppvdemo.ini
To: A CGI directory served by your Web server
3. Copy Sample HTML Pages to Your Web Server
Copy all supplied html and gif files to an HTML directory of your Web Server.
Copy: (RealServer main directory)/Commerce/html/permissions.html
(RealServer main directory)/Commerce/html/register.html
(RealServer main directory)/Commerce/html/secure.html
(RealServer main directory)/Commerce/html/welcome.html
(RealServer main directory)/Commerce/html/backdrop.gif
(RealServer main directory)/Commerce/html/rnlogo.gif
To: A document path served by the your Web server
4. Edit the PPVDemo Configuration File
The ppvdemo.ini file is a plain text file used by the PPVDemo program. Now that you've copied ppvdemo.ini to your Web server, open it in its new location and edit it with a text editor. On each line that does not begin with a semi-colon (;), substitute the correct values for any that do not match your RealServer or Web server configuration.
A note about ppvdemo.exe:
The ppvdemo.exe program accepts two commands: insertuser or grantaccess.
Web pages supply the commands, based on what the user typed.
Example of insertuser command:
ppvdemo.exe?command=insertuser&userid=testuser&password=testpassword
Example of grantaccess command:
ppvdemo.exe?command=granataccess&userid=testuser&password=testpassword&url=secure/test.rm&urltype=0&permissiontype=0&permissionlength=0
ppvdemo.exe?command=granataccess&userid=testuser&password=testpassword&url=secure/test.rm&urltype=0&permissiontype=1&permissionlength=12/12/2012:12:00:00
ppvdemo.exe?command=granataccess&userid=testuser&password=testpassword&url=secure/test.rm&urltype=0&permissiontype=2&permissionlength=12
ppvdemo.exe?command=granataccess&userid=testuser&password=testpassword&url=secure/test.rm&urltype=0&permissiontype=2&permissionlength=0
5. Edit Sample HTML Pages
a. In register.html (which you just copied to your Web server), locate the following text:
<!-----------------------------------CGI URL--------------------------------->
<form action="http://localhost:80/cgi-bin/ppvdemo.exe" METHOD="GET">
Replace the following text:
http://localhost:80/cgi-bin/ppvdemo.exe
with the URL of the ppvdemo.exe file (which you copied to your Web server
in Step 2) as it resides on your Web server.
b. In permissions.html (which you just copied to your Web server), find the text:
<!-----------------------------------CGI URL--------------------------------->
<form name="pForm" action="http://localhost:80/cgi-bin/ppvdemo.exe"
METHOD="GET">
Replace the following text:
http://localhost:80/cgi-bin/ppvdemo.exe
with the URL of the ppvdemo.exe file (which you copied to your Web server in Step 2) as it resides on your Web server.
c. Also in permissions.html, locate the following text:
<!-----------------------------Secure Media Selection------------------------->
Make sure the following text in this section matches the name and path of the Secure directory on your RealServer:
value="secure/sample1.rm"
value="secure/sample2.rm"
d. In secure.html (which you just copied to your Web server), locate the following lines:
<!------------------------------Secure Media File #1--------------------------->
<li><A HREF="http://localhost:8080/ramgen/secure/sample1.rm">
Sample #1</A>
<!------------------------------Secure Media File #2--------------------------->
<li><A HREF="http://localhost:8080/ramgen/secure/sample2.rm">
Sample #2</A>
If your RealServer secure directory is not named "secure", replace the word "secure" in the URL with the correct directory name.
6. Browse to welcome.html and start registering!
Start the demonstration by pointing your browser to the welcome.html
page. Click on "Click here to register" and you'll see how you or your
users can self-register.