Showing posts with label mediatemple. Show all posts
Showing posts with label mediatemple. Show all posts

Thursday, August 6, 2009

Working with Alfresco in Java EE

I've dedicated some serious hours to installing and deploying Alfresco on a MediaTemple (dv) VPS. The result has been a revelation of sorts. It's the big time for open source enterprise content management (ECM) and there's no going back.

Alfresco is like having your own personal cloud-based Google Docs to customize and host as many secure accounts as you like. While set up and configuration are not a cakewalk, it can be done. I took some decent notes on the process, so I will check back in to detail the process of configuring MediaTemple's vps environment.

In particular, I will show a method to set up a new JDK, fine tune Plesk and the Apache environment, and finally modify some scripts in Alfresco with the result of a successful java build.

That aside, the Java EE with Alfresco is a beast on memory. If there is any hidden cost on running the community edition of Alfresco, that may be it.

Thursday, July 16, 2009

Version Control with Subversion

Setting up version control for, among other things, Flex code repositories, is not too hard to set up with Mediatemple (dv) accounts. SVN is already ready to run from SSH.

I followed these steps to get it up and going. What's more, it works.
  • Svn on mediatemple knowledgebase article is here
  • Great overview on bit-101.com
Good luck with your own implementations.

Update: I set up a SVN repository server on my account and it is simple to use in Eclipse projects. Once your repository is configured, whenever you start a new project, simply right click it in Eclipse, then choose Team > Share Project... All you have to do is enter your username and password, and the IDE will take care of starting a new svn repos. The dark master will be pleased...

Thursday, July 9, 2009

Django AMF Service

Now that the basic Django framework is in place (admin, views, urls), the focus shifts to data and services. In the past, WebORB has been adept at providing RPC between ASP and RIA, so it's tempting to use it again in a Linux environment.

Since the current project is Apache, one option is to utilize Apache Tomcat. Tomcat is readily available in MediaTemple's (dv) configuration to provide a pure Java HTTP server environment. This would pair well with WebORB for Java, a robust middleware solution for RIA data synchronization.

Good enough but the tiers don't fully align with the planets yet. My goal is to utilize remote procedure calls to mySQL and take advantage of the schema I've built in Python-based Django. That will not be possible until my Python objects can be called from Java. So, is it possible to port Python code to WebORB via a Python -> Java compiler?

In a word, Jython.

Jython runs in Tomcat as an implementation of the Python programming language. By compiling the Django code, Jython could route between Flex on the front end and the mySQL admin system within the framework of Django.

Incidentally, I'm not going to implement this cookbook recipe just yet. I've worked with WebORB and am sold on it's strengths, but in this instance I'm looking for a lighter and more agnostic solution for the frontend than a uniform rich presentation server.

Namely, I'm going to move forward with Django AMF PyAMF. This allows some of Django's front-end capabilities to shine, and also enables javascript and ajax elements to be plugged into the site design.

More posts to come on this direction.

Out of curiosity, has anyone else tried the setup I outlined above, i.e. Django <-> Java <-> RPC tier <-> RIA? Furthermore, would you go a completely different route or change any of the tiers from the architecture I outlined? It is one of countless possibilities, and on that note, in my experience, one of the most direct and stable available.

Tuesday, June 30, 2009

Last (?) post about MediaTemple (dv) and Django

This is a refinement of a previous post on the topic of Django integration into a MediaTemple (dv) account. Following a talk with MT and reading some knowledgebase info, here is the quick route to Django configuration happiness - now more better.

This is how we do it:

Add to base config aka /etc/httpd/conf/httpd.conf the following in the appropriate section:
LoadModule wsgi_module modules/mod_wsgi.so
And in the appropriate section, add this too:
NameVirtualHost *:80

#Add a VirtualHost Section for each Name-based virtual server

<VirtualHost>
ServerAdmin email@email.com
ServerName www.URL.com
ServerAlias URL.com *.URL.com

DocumentRoot /var/www/vhosts/URL/httpdocs

<Directory /var/www/vhosts/URL/httpdocs>
Order allow,deny
Allow from all
</Directory>

</VirtualHost>


then save the file and exit the editor.

In the directory of path '/var/www/vhosts/(DOMAIN NAME)/conf' there is a file called 'httpd.include.' It holds unique config info for each virtual domain. It is rebuilt automatically from time to time based on Plesk. Instead of editing that file, make a new one called 'vhost.conf' (if it doesn't already exist) and add the following info to this file:

WSGIDaemonProcess URL.com processes=1 threads=1 display-name=%{GROUP}
WSGIProcessGroup URL.com
WSGIScriptAlias /myapp /home/username/django/scripts/URL.com.wsgi

<Directory /home/username/django/scripts>
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/URL.com-error_log
CustomLog /var/log/URL.com-access_log common
Notes on the above, in brief
  1. LoadModule is in httpd.conf
  2. NameVirtualHost declaration is in httpd.conf
  3. virtualhosts make use of /virtualhostname/conf/vhost.conf
  4. WSGIScriptAlias declarations are in respective vhost.conf, not in httpd.conf*
* This is because WSGIScriptAlias in httpd.conf didn't work

Once that is configured as you like, simply restart the server in this manner:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=mt-example.com 
service httpd graceful

Now test your django. With any luck, you will see a screen confirming a correct installation.

Thursday, June 25, 2009

Python Image Library (PIL) on MediaTemple (dv)

When you're on MediaTemple (dv) with root access, first get the TAR from here. As of this post, the latest version is 1.1.6.

wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz

Untar in the usual way.

tar zxvf Imaging-1.1.6.tar.gz

Then, go into the created folder and install the package using:

python setup.py install

If all goes well your ssh will echo many installation processes, following which you will have an amazingly easy time working with images via http.

Wednesday, June 24, 2009

Subversion on MediaTemple (dv)

Just completing some upgrades to my service to incorporate subversion. I don't know how I got by without it for so long. My first exposure to version control software was Visual SourceSafe back in the dark ages, and since then I've either used that or similar routines involving backups and multiple versions in similarly-named folders. Subversion is a lean, command-line, open-source version of the same. Here's what I did.

In the case of MediaTemple, Subversion is already installed. All you have to do to get started is invoke a new instance on the command line.

svnadmin create /name/of/project/folder

Then build a project to import into svn, such as

tmp/project/trunk
tmp/project/branches
tmp/project/tags

Jump into the trunk and add some files to it

file1
file2
file3

When you import the project, subversion vacuums it all up.

svn import /tmp/project file:///name/of/project/folder -m "initial import"

Note the -m, ensures you won't get an error for not setting the default text editor for subversion. In case you would like to set it, just use the command:

export SVN_EDITOR=vi

Now you can checkout files using the checkout command

svn checkout file:///name/of/project/folder/trunk project

And you can post your revisions using commit

svn commit

Notice the difference in directory structure between creating, importing and checking out. Creating and importing require only the folder, but checking out requires the additional trunk folder and project name specified.

Here are some additional resources of note for subversion installations, with an emphasis on MediaTemple (dv) installations.

Ayman Hourieh Subversion Tutorial - quick and to the point.

Tony Spencer's Tutorial - includes basic WebDAV integration, also quick and to the point.