William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

Tag Archives: lamp

LAMP setup for Windows

I wrote a summary list to install and setup LAMP in Windows. According to my experience, it is very useful and stable. The LAMP –
For the ‘L’ (linux), using Cygwin,
For the ‘AMP’ (apache+mysql+php), using XAMPP, a excellent package

(1) Cygwin
If you like to program directly under Linux in a MS operating system, Cygin is a key choice.
Cygwin is a Linux-like environment for Windows.

It consists of two parts:

  • A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
  • A collection of tools which provide Linux look and feel.

If it is possible, install as many packages as possible. e.g, ‘man’ packages, perl, devel, etc. But don’t include X- packages which are related to GUI.
Don’t forget vi, the simple and poweful full-screen text editor, which is my favorite.

(2) XAMPP

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use – just download, extract and start. The entry point for download:

http://www.apachefriends.org/en/xampp-windows.html

The newest version of XAMPP 1.7.3 include:

  • Apache 2.2.14 (IPv6 enabled) + OpenSSL 0.9.8l
  • MySQL 5.1.41 + PBXT engine
  • PHP 5.3.1
  • phpMyAdmin 3.2.4
  • Perl 5.10.1
  • FileZilla FTP Server 0.9.33
  • Mercury Mail Transport System 4.72
  • OpenSSL 0.9.8l
  • Webalizer 2.21-02

They are perfectly integrated together, all the tools included and configure very well.
What you need to do are, – after the installation – edit httpd.conf and php.ini directly to make your website (http://localhost/) immediately reflect your projects.

Besides the basic, some useful tools can make the development conveniently and quickly.
(3) Front-end
Of course it is Adobe Family: Dreamwwaver, Photoshop, Illustrator, Flash, etc.

(4) Apatana (EClipse) php

Build web applications quickly and easily using the industry’s leading web application IDE. Aptana Studio harnesses the flexibility of Eclipse and focuses it into a powerful web development engine.

(5) git or cvs

for version control. git seems more hot over cvs, however they are very similar.
Normally they are included in Cygwin, check from command lines. If not, add either of them for version control purpose.

(6) Some optional, but very helpful softwares:

  • UltraEdit-32
  • VC++ 6.0 for technical notes and project documentary management.

(7) And, For FireFox, google Chrome Addons:

  • Firebug – Web Development Evolved.
  • FireShot (charged) – captures, edits, annotates, organizes, exports, uploads and prints screenshots of your web pages.
  • Web Developer – adds various web developer tools to a browser.
  • FirFTP – FTP Client for Mozilla Firefox.
  • CoolPreviews – browser Faster. Preview and share links and media without leaving your current page.

With all of these assembled, the true and powerful LAMP-alike developing env are well setup for Windows.

Drupal modules: automatically install in LAMP

Some developers install Drupal modules like this:
By looping individual module in Windows:

  1. download the module into local directory
  2. unzip
  3. ftp the module to server’s Drupal module directory.

This is tired work. I wrote a shell script to automatically install all the modules in LAMP without hand interference.
The steps are:

  1. Collect all the modules you want to install, put them in a seperate file, or simpler in this example, put in the script.
    my modules are: views-6.x-2.11.tar.gz cck-6.x-3.x.tar.gz token-6.x-1.15.tar.gz pathauto-6.x-1.5.tar.gz devel-6.x-1.22.tar.gz admin_menu-6.x-1.6.tar.gz advanced_help-6.x-1.2.tar.gz ubercart-6.x-2.4.tar.gz
  2. runing the following script: $ drupal_module_install.sh
    That’s it.
  3. If you want to customize the module from command-line, like:
    $ drupal_module_install.sh views-6.x-2.11.tar.gz
    Pretty easy.

#!/bin/bash

DRUPAL_MODULES='views-6.x-2.11.tar.gz cck-6.x-3.x.tar.gz token-6.x-1.15.tar.gz pathauto-6.x-1.5.tar.gz devel-6.x-1.22.tar.gz admin_menu-6.x-1.6.tar.gz advanced_help-6.x-1.2.tar.gz ubercart-6.x-2.4.tar.gz'

DRUPAL_DIR=$HOME/drupal/
TMP=$DRUPAL_DIR/tmp/
DEST=$DRUPAL_DIR/sites/all/modules/

if [ ! -d $TMP ]; then
	mkdir $TMP
fi
cd $TMP

if [ $# -eq 1 ]; then
		module=$1
		strip_name=`echo $i | cut -f 1 -d -`
		if [ -d $DEST/$strip_name ]; then
			echo "The '$module' already exists in $DEST.\nTo install new, delete it first."
			exit 8;
		fi
		wget http://ftp.drupal.org/files/projects/$module
		tar -zxvf $module
		mv $strip_name $DEST
else
	for i in `echo $DRUPAL_MODULES`
	do
		strip_name=`echo $i | cut -f 1 -d -`
		# or: $strip_name=`echo $i | sed -e 's/-.*$//'`	
		if [ -d $DEST/$strip_name ]; then
			echo "The '$strip_name' already exists in $DEST. Ignore. To install new, delete $DEST/$strip_name first."
		else
			wget http://ftp.drupal.org/files/projects/$i
			tar -zxvf $i
			mv $strip_name $DEST
		fi
	done

fi
cd -

This saves time. For other modules installation, e.g Perl’s modules, PHP’s packages and libraries, the same method is applicable.

The LAMP CMS Trends

LAMP-Linux/Apache/MySQL/PHP CMS-Content Management Systems like Drupal, Joomla and WordPress are becoming very popular among web developers as total solutions for clients. Why? I think that despite the first sense of overkill there are three key attractions to LAMP CMS for  Web users.

1)They run on every OS platform from Linux through MacOS to all the flavors of Windows and quite a few Unix versions as well. So they fit on nearly whatever server the client is running be it in-house or a hosted environ- no small attraction, especially for Intranet builds.
2)Most are easy to add new postings and content to. The beginning users definitely does not need to learn the ropes for full site administration; but for the crux of site maintenance: adding new posts, editing content, and planning for new features and styling, all the major CMS provide very adept and controlled WYSIWYG features to support these all important Web presence operations.
3)They easily allow users to grow into the full capabilities offered by the CMS. All of the above CMS systems have huge libraries of well tested plugins/extensions plus a wealth of themes and templates to give a site a layout and formating to meet every need. Don’t underestimate the value of being able to add on a shopping cart ecommerce extension  or a full gallery viewing capability or an online forum when they have proved themselves ready, willing able to afford the time and effort to support such a Web identity.

But there are two more reasons that the LAMP CMS are very popular – they are all Open Source and they are free. For Drupal, Joomla, and WordPress the base system is available free under some Open Source license. So this means the out of pocket costs for installation are low and there are hundreds of developers that are a)making new plugins/extensions plus themes and styling templates [most of which are also free]. So if you have a problem and can’t write your own extension [and that is getting easier too], then likely somebody else has done so. In sum, as a developer I think of LAMP CMS systems as large scale and highly customizable coding blocks or objects that I can TinkerToy or Lego-block fit together for low cost but highly effective systems.