Open Chinstrap

April 12, 2008

Installing Google App Engine SDK on Linux

Filed under: Linux, Ubuntu, Web Development — t-roy @ 10:24 am

You will need to have python 2.5 installed on your system but most distros of Linux already have python installed (just verify what version it is) . First download the the SDK from here. Save the zip file to your home directory in my case I saved it to:

/home/scottt

Now you can unzip the file in the home directroy:

$ unzip google_appengine.zip

Go to the google_appengine directory:

$ cd google_appengine

To test out the installation you can start the dev server and run the simple guestbook application that comes with the SDK:

$ ./dev_appserver.py demos/guestbook

By default the app server uses port 8080. You can access the guestbook application from your browser at:

http://localhost:8080

If you are using a linux server with multiple developers you may need to specify a different port in order to run your application:

$ ./dev_appserver.py -p 8090 demos/guestbook

This time the application will run on port 8090. I you want to install google_appengine on Windows check out this post on my other blog .

Troy

April 7, 2008

Configuring Eclipse EPIC on Ubuntu

Filed under: Apache, Linux, Perl, Ubuntu, Web Development — t-roy @ 7:14 pm

E-P-I-C is a good Perl plugin for Eclipse (Version: 3.3.2 Build id: M20080221-1800) . You can use EPIC to develop perl scripts and Perl CGI (Common Gateway Interface) scripts. To install the plugin you can use the update site located here:

http://e-p-i-c.sf.net/updates

Creating a Perl project is very straight forward: File>New>Perl Project

New Perl Project

 

 

 

I will focus on configuring a CGI script since the regular Perl scripts are fairly straight forward . First we need to create our script by right-clicking on the project folder and selecting New>Perl File:

New Perl File

 

 

 

Name the file test.cgi and copy and paste the following simple CGI script:

#! /usr/bin/perl

print “Content-type: text/plain \n\n”;
print “Hello World!\n”;
print “Script Name: $ENV{SCRIPT_NAME}”;

Save the file (CTRL-s) and now we are ready to set up the Perl CGI Configuration. But before we do that it is important to record the full path of the Perl Eclipse project and remember the name of the script you want to run. Eclipse usually creates a workspace directory in your home directory unless you specify otherwise. In my case my workspace is located in:

/home/scottt/workspace

Therefore my Perl project is located in:

/home/scottt/workspace/perlwebscripts/

And the path to my CGI script is:

/home/scottt/workspace/perlwebscripts/test.cgi

Now that we have this information we can configure our CGI script. Right-click on the project folder or any file in the project and select Run As>Open Run Dialog…. :

Perl CGI Configuration

 

 

 

 

In the Main tab you need to select the project folder name in my case it would be perlwebscripts. The Web Server tab (shown above) contains the following information:

  • HTML Root Directory: /home/scottt/workspace/perlwebscripts
  • HTML Startup File: /home/scottt/workspace/perlwebscripts/test.cgi
  • CGI Root Directory: /home/scottt/workspace/perlwebscripts

All paths are related to your Eclipse CGI project. The final thing to configure is the browser tab which is where the result of the CGI Script is displayed. I used the Firefox adapter. I was not able to get the Internal Perl Browser to work. The Firefox browser works fine but it is a bit of a pain to Alt-Tab between Eclipse and Firefox while you are developing. Hit apply once the configuration is finished and then you can click Run As. Here is a screenshot of the test.cgi script :

CGI Test Script

 

 

 

 

EPIC also provides a good user guide which you can download from here.

Troy

Blog at WordPress.com.