When I first created MobilePebbles , the Mobile Theme Generator was installed on the primary domain. I soon decided to place the generator on a sub-domain and install Mezzanine on the primary. The site is hosted by Webfaction. Although Webfaction has install scripts for quite a few apps (Drupal, Django, etc), they do not currently have one for Mezzanine. But, without too much trouble (thanks to the tools that are availed to Webfaction customers), I was able to install Mezzanine on Webfaction.
Although there are many advantages to installing Mezzanine using Python’s virtual environment, I decided against it. I already have Django installed on Apache using mod_wsgi, so my Ubuntu install is already primed. Although I followed the basic steps as discussed in a previous post (Setting up Django with Apache and mod_wsgi on Ubuntu 11.10), there were a bit more steps involved with setting up Mezzanine – especially as it relates to how and where to serve static files.
In my last post, I discussed how to set up Django with Apache and mod_wsgi. In this post, I will discuss how to set up a sub-domain to serve static files (css, js, images, etc). The Django documentation states that using a sub-domain for static files is recommended.
Note: Although I set up my Django installation on Ubuntu, most of these instructions are common to most OS’s.
I beginning a new project where I decided to use Django. I briefly worked with Django for an embedded device over two years ago. Now I am creating a full-fledged web application using Django and jQuery.
When setting up Django, I initially followed the tutorials on djangobook.com. While the site is a good starting point for learning Django, it lacks some details, especially as it relates to serving static files (css, js, etc.) while using the development server. After struggling with the display of my css files, I decided to use Apache instead of the development server. After all, the development server will not be used in production, so I would rather duplicate a production environment as much as possible. In my opinion, the primary reason for using the development server is for debugging, but so far, I have found that Apache’s error log has been pretty good.
I plan to create Drupal video tutorials in the near future. Although I use a Mac as my primary development box, I have Adobe Captivate installed on my Windows PC. So I installed Drupal on my PC and I ran into problems that required Apache configuration changes.
The Problem: When I clicked on the ‘Administer’ link on my site’s home page, ‘index of/‘ and a list of my site files and directories displayed instead of the administration page. In fact, any page that I attempted to go to resulted in this ‘index of/’ display.
The Solution: I opened the Apache configuration file (httpd.conf) and found that the Allowoverride for .htaccess files was set to None. I set Allowoverride to All and restarted Apache.
The Problem: I always enable Clean URLs, but for some reason, I was unable to on my PC.
The Solution: I again opened my httpd.conf file and found that Apache’s mod_rewrite module was not enabled (this must be enabled in order to use Clean URLs). So I uncommented the line that loads the module and restarted Apache.
Now Drupal is running perfectly on my PC. I was a bit surprised that I had not configured Apache prior to this, but I guess that I use my Mac (and Ubuntu) so much that I never found the need. Enjoy.
After installing CakePHP on my Ubuntu box, I viewed the default home page in my browser and noticed that the page was not styled. Cake did not know the path to the CSS file because I had not enabled mod_rewrite. Although I could opt to setup CakePHP to work without mod_rewrite, I decided to enable it.
I’ve developed in the Windows environment for most of my career. About 4-5 years ago I began to migrate to the Mac. Now my Mac is my primary computer.
I recently worked on a project where the target OS is linux, so I installed Ubuntu 9.04 desktop on an old PC. The following are the steps I took to create a web development box. This post assumes that you have already installed Ubuntu. Click here or here for installation instructions.
Next, I will install Python, Django, PostgreSQL, phppgadmin, and pgAdmin (needed for my new project). I will also install Aptana Studio and Java (need JRE to run Aptana). I have been using Aptana Studio on my Mac for over a year, and it has become my default development IDE.