Thursday, April 30, 2009

Perl web support on Ubuntu 8.10 Server

I had this project where we need to add PERL support in a website folder called cgi-bin. Here is how I got it working and what changes I need to to make.

Install PERL if not already installed.
apt-get install perl
Apache configuration: load the following in the apache mods-enabled
cd /etc/apache2/mod-enabled
ln -s ../mods-available/perl.conf
ln -s ../mods-available/perl.load
Website configuration:
<VirtualHost *:80>
        DocumentRoot "/home/USER/WEB_root"
        DirectoryIndex index.html index.php default.php index.htm
        ErrorLog /var/log/apache2/YOURHOST_error_log
# information in here
        ScriptAlias /cgi-bin/ /home/USER/WEB_root/cgi-bin/
        <Directory /home/USER/WEB_root/cgi-bin/>
                Options ExecCGI
                AddHandler cgi-script cgi pl
# Rest of your information

Thursday, April 16, 2009

Red5 video recorder installation setup

So I was amazed how long it took me to finally get this up and working. Actually I am quite embarrassed once I figure it out how easy it is. I scoured the web for days looking for any tips on how to get this going until I installed all of the plugin information and got things going. Before we begin you should know that I am doing this via Eclipse and a few plugins so if you don't have this stuff at your beck and call then stop now and keep looking.

I am assuming that you checked out my previous post for the installing Eclipse and also the Red5 plugins? Here are the links to the posts:

For Mac OS X. Includes the Flex plugin as well please download the red5 plugin

For Linux Ubuntu (Should work for other flavors). Install eclipse and then just add the plugin

Ok now we need to get the Red5 Recorder software which is at this link:

Now open eclipse and after you have everything installed. Read and watch the video in this post. Make sure read the part about building the application, "OK, now for building the applications...". I am going to breeze through this pretty fast.

Ok so here we go really fast...

Create a new Dynamic Web Project and call it "red5recorder". Your now have two main folders, one ends in "Client". Expand the Eclipse project "red5recorderClient" so you see the structure. Note that the file you download loaded has the same set of files. I opened up (2) windows and just removed all of the files from the eclipse project and replaced them from the "". I then did a refresh in eclipse just to make sure it could see the files I swapped out.

Now you will need to Right click on the main red5recorder project (not the red5recorderClient) and then run as Server. It will go through and compile everything for you and move a copy of the files into the Red5 Server. Then Right click on the red5recorderClient and either Run as OR debug as. The application should work fine and the application should be working as planned.

I will post more about this coming up very soon and how to embed this into a webpage and also into a form. Keep watching for more posts.

Mac OS X 10.5 Java 1.5 or Java 1.6

Most people don't know this but you can change the Java version from 1.5 (default) to 1.6 just by dragging the preference.

Open -> Applications -> Utilities -> Java -> Java Preferences

It is a bit slow so give it a few moments. Once it is open you can choose the Java version just by dragging it in the list. I needed it for changing the versions of Red5 compiling the programs.

Red5 application install from Eclipse

So this is a bit of a tricky to explain but one that I think will help most people. Also let me say this is quite easy to do once you have everything in place, took me forever to figure out until I found this video online, I must have watched it like 100 times (really not kidding.)

So here is what I did to get everything setup. Please note I am on Mac OS X 10.5.x, I am sure that windows will be very much the same in overall. Please note that I like linux and wish they had the flex plugin for that platform but not yet.

First, I got the latest version of the eclipse 3.4.2 (newer version should work), I installed it on my machine.

Second, I got the flew plugin for eclipse which is a 30-day trial and apparently will be free eventually but not yet. I installed it on my machine.

Third, I downloaded the latest version of Red5 on my machine which in the case of the Mac was the 1.5 version. I installed it (not an installer but rather a folder with the files) in my Sites directory.

Fourth, I tested the red5 server from command line to make sure everything was in order and then once it worked I quit the server.

Fifth, I then started up the eclipse IDE and then added a new server, I told it that it is a Red5/Flew server and set up all of the paths to the start up scripts. I then tested the server by starting it up from the GUI. Everything worked.

OK, now for building the applications, now again watch the videos, it was not apparent to me the first 50 times.

First, Create a New -> Dynamic Web Project. Type in the name of the project which will eventually be loaded into the webapps/ folder of the Red5. Choose wisely as most of the linux systems don't like spaces and special characters, try "myproject" for example. Then choose the Target Runtime which should be the Red5/Flex. Then the Project Facets, choose the Red5 Application Generation. This actually creates the container for the application.

Second, On the left side of eclipse you will see what looks like (2) projects. One is the Client which installs on the Red5 and the other is all of the Java hooks needed to compile the application to run.

Third, I want to PUSH the application over to the server by right clicking on the PROJECT (not the one ending in Client) and say "Run as" then "Run on Server". Then choose the Red5 Server you setup above. It should then boot up the Red5 server and don't worry it moved the files to the directory and then starts it up. I would double check to make sure it did everything.

Fourth, You want to then test the application by right clicking on the actual "xxxClient" folder and then either "Debug as" or "Run as" Flex Application. You should now see the application come to life.

Now you can install some cool applications from the web. I will post the one for red5recorder in my next post. Hope this works for everyone, again watch the video.

Ubuntu 8.10 Apache mod_ajp to TomCat6

So I had this project where we needed to have the Tomcat handle the JSP pages from a website. I had to install a few mod to apache and then setup the ProxyPass to handle the requests. Now I may have enabled too many mods so you can activate them one at a time until you get it working. Here are the mods I added to Ubuntu 8.10 standard install:

proxy_ajp.load, proxy_balancer, proxy_connect.load, proxy_http.load, proxy.load

AGAIN, I may have activated too many but I will need some of them for things like ruby later. I did not alter any of the information in these files.

Here is the site config I added to the virtual host file:
<IfModule mod_proxy.c>
     ProxyPass /DIRECTORY ajp://localhost:8009/DIRECTORY
Where the directory pass through is the same as /webapps/DIRECTORY on Tomcat6

Next we had to make some changed to some of the files which might not apply to your application:
nano etc/tomcat6/policy.d/04webapps.policy
In that file we had to make some changes to the read and write:
permission "/FOLDER/APPLICATION/sessions/*", "read, write";
Note that we put in the application in the home folder of a user and then did an "ln -s" into the TomCat6 webapps folder so that the user could change the files for the application. It needed to write session information to a folder and have permissions.

I hope this helps anyone trying to get things going.

Wednesday, April 15, 2009

TomCat6 on Ubuntu 8.10

I did a clean install on an ubuntu 8.10 server OS. I had problems figuring out the path for the files until I decided to take a look at the test page which had all of the information.


this should give you all of the information you need. Just incase you can't get the page up and running which means you have bigger problems check out the folder...


Good luck, I will post more stuff as I learn more.

Thursday, April 9, 2009

Eclipse Red5 Plugin

I scoured the web looking for the Red5 plugin and finally found the location for the plugin. Here is the URL and the directions for installing it.

Let me know if this page goes away and I will update with a new link.

Wednesday, April 8, 2009

Eclipse SVN Plugin

I needed to find the plugin for the Eclipse here is how you add subversion for eclipse.

Help > Software updates > Add Site...

I needed the version from which was the latest. Check the version you have first


Mac OS X

Once you enter the new site select all of the packages, I chose all of the packages.

Red 5 Ports

Just incase you need to know the ports for Red5.

Default ports:

RTMP: 1935
RTMPT: 8088
HTTP servlet engine port: 5080
Debug proxy port: 1936

Tuesday, April 7, 2009

Ubuntu 8.10 Server install Java6

I am doing a fresh install of Red5 on Ubuntu 8.10 Server. I need to get the latest version of the Java6 for this to work. Here are the set of commands to get it installed.

Running as root
apt-get install sun-java6-jre
Then just look for the direction for getting Red5 up and running.

Additional Packages from Sun/Ubuntu:
  • sun-java6-bin - Contains the binaries
  • sun-java6-demo - Contains demos and examples
  • sun-java6-doc - Contains the documentation
  • sun-java6-fonts - Contains the Lucida TrueType fonts from the JRE
  • sun-java6-jdk - Contains the metapackage for the JDK
  • sun-java6-jre - Contains the metapackage for the JRE
  • sun-java6-plugin - Contains the plug-in for Mozilla-based browsers
  • sun-java6-source - Contains source files for the JDK

Raspberry Pi Zero W - Wireless Configuation

create the file under "boot" folder wpa_supplicant.conf country=GB ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev u...