This guide is taken from my site, zimmertech.com at this URL:
http://www.zimmertech.com/tutorials/...evelopment.php
Web Development in Linux
Tips and Tricks about designing web sites in Linux
The purpose of this guide is to help Linux users be better and more efficient web developers without running Windows.
Advantages of Linux
Linux has many advantages over Windows. For me, it is much more stable then Windows. I can keep my machine running without a reboot for an average of 4 months. That said, Windows XP is much more stable than ME or 98, which I had been running before. Another advantage is multiple workspaces. When I work, I can usually have over a dozen programs running--a few Firefox windows, IE, Photoshop, Email, FTP, local terminal, SSH, a coding program, a billing program, a bunch of directories, etc. This can quickly fill up a Windows taskbar. In Linux, I can keep everything organized. All coding windows in one workspace. All server windows in another (SSH and FTP). Last, if you use a LAMP environment (Linux/Apache/MySQL/PHP), then you can easily test on your own server before ever uploading to the web. Windows cannot perfectly emulate this.
Program Installatoin
Almost all of the programs that I listed can easily be installed through System | Administration | Synaptic Package Administrator) or at the command line through "sudo apt-get install programname". For the Windows programs, install wine, then download the Windows executable. Then type "wine programname.exe" in the terminal to install. So whenever you see a program name in this guide, try installing the package through Ubuntu's Synaptic Package Manager.
Coding
There are many options for coding in linux. Emacs, vim and a host of other editors such as gedit work fine. I prefer programs specifically built for web development such as Bluefish for Gnome or Quanta for KDE. These programs provide a lot of added functionality such as project management, tag help, table/form builders, syntax checking, and many useful plugins (such as tidy to beautify your code). Another option that I like is the internal preview. I can hit f5 to preview the current document in a inline browser without changing windows. Unfortunately, this will not run PHP code, so sometimes it is not very useful. Regexxer is a great GUI program that will let you do universal search and replaces. So you can search all of the files on your hard drive for a certain text string, then replace it with something else. It uses Perl style regular expressions so it's power is almost endless.
FTP
I have not found a great FTP program for Linux yet. gFTP is the best I found, but I don't like its interface and I've had problems with it. So for most jobs, I run my favorite FTP program Filezilla under Wine.
SSH
When I look for hosting, one of my requirements is SSH access. Because I use a lot of content management systems, SSH is incredibly valuable. Instead of extracting Exponent locally then spending all day FTPing the files up, I upload the compressed version and then uncompress it using SSH on the other end, saving a ton of time. Or if there are permission problems on files, I can use a recursive chmod (chmod -R 644). If you are reading this guide, I'm sure you know the advantages of the linux command prompt. The "ssh" command works fine from Linux, or Putty runs perfectly under Wine if you want an easier to use program with more options.
Graphics Design
Linux is weak in graphics design. Almost all graphics design programs are meant to run on Windows. Luckily, there are a few options.
VNC
The first option is to not run your graphics design program on Linux at all. This is the most problem free solution because your graphics program (probably Photoshop or Paint Shop Pro) will be running on a Windows machine. The downside is speed. You can forget using brushes. But this option worked for me for almost a year. First, you need to have a windows machine on the network. On that machine, install TightVNC, and start up the TightVNC server. Then on your Linux box, install a program such as krdc to connect to this VNC machine. Just type in the servers IP address, followed by a ":0". So for me, I enter "192.168.1.105:0".
Wine / Crossover
Wine and Crossover are Windows emulators that run on Linux. They allow you to run many Windows programs in Linux. Wine is free and can run many Windows programs including Photoshop 7.0. But it still has problems with many programs. A slightly better product is Crossover. Crossover Office is not free, but costs about $40. But it will run many popular programs almost perfectly--including the entire Microsoft Office suite, and Photoshop 7.0. Unfortunately, even Wine and even Crossover cannot run Paint Shop Pro, or Photoshop CS (and CS2), so you have to use older software. Another downside to this option is that there are bugs and glitches.
GIMP
GIMP is an open source graphics design program built for Windows. It is a very capable program. In my opinion, it is not as good as Photoshop for a variety of reasons--more difficult interface, less options, and less tutorials on the internet. But if the other options do not work, consider GIMP.
Local Server
There are many advantages to designing locally. Mainly, you don't have to FTP every file that you change each time you want to test something.
To install, follow these instructions. These are taken from a great guide to installing a public Ubuntu server.
MySQL
Type the following in the command line
Code:
apt-get install mysql-server mysql-client libmysqlclient12-dev
Then to set your mysql root password:
Code:
mysqladmin -u root password yourrootsqlpassword
Apache and PHP
Code:
apt-get install apache2 apache2-common apache2-doc apache2-mpm-prefork apache2-utils libapr0 libexpat1 apt-get install autoconf automake1.4 autotools-dev libapache2-mod-php4 libkrb53 php4 php4-common php4-dev php4-imagick php4-mcrypt php4-rrdtool php4-sqlite php4-curl php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt
Now place your web files in "/var/www/" or "~/public_html/". Make sure that your files are chmoded to at least 644 (owner read/write, group and other read). Now open up your browser. For files in "/var/www/", type "http://localhost/" and for files in "~/public_html/", type "http://localhost/~username/".
Unless you love editing your mysql database through the command line, I would recommend using a GUI program to create/edit databases. My favorite is phpMyAdmin. It is web based, so install it in /var/www or ~/public_html/. This is a package in Ubuntu that will automatically install in your /var/www, so to use it, just type in your browser "http://localhost/var/www/phpmyadmin/" (http://localhost/phpmyadmin/ also works)
There are a few things you want to do to configure apache. You probably want to enable .htaccess. To do this, type "sudo gedit /etc/apache2/apache2.conf", then add this at the end:
Code:
<Directory />
AllowOverride None
</Directory>
<Directory "/var/www">
AllowOverride Options
</Directory>
#copy and paste this to allow .htaccess in specific directories
<Directory /var/www/directorytoallowhtaccess>
AllowOverride All
</Directory>
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/[^.#]*
Before this will work, you need to restart apache. In the command line, type "sudo apache2ctlrestart".
Thats it! You have a working Linux server
Testing
IE runs well under Wine. To ease your install, use "winetools".
Other
Karm is a great billing program. You can easily record the time you work on each project, then easily print out a invoice with your total time and history
Another idea that you might want to consider is to get dual monitors (using 2 monitors at once). This saves the time from switching between desktops--you can code for a Window and review the result without minimizing or maximizing anything.
Thats it! If you have any other tips and advice, please comment below.
Thanks!
Bookmarks