I'd like to have at least three components:
1) a webserver - with apache and a java servlet container.
2) a data server - mysql database and a subversion repository too
3) a dev server - a beefy machine where i can test and run applications under development before pushing them to the webserver or data server.
Laptops will log into all of these machines and also keep copies of any software development into these severs too.
Its a lot easier to use a virtual cluster. In this case -one machine with three VMWare instances on it.
Window > Open Perspective > Other... > SVN Repository Exploring.
Setting up Virtual Servers
VMWare Server is free and setup is easy on windows XP with its a SetUp.exe file. The cluster will be linux boxes. I download Hardy Heron Ubuntu 8.04 DVD iso images for both the server and desktop versions from ubuntu.com.
I made a webserver, a database, and a dev machine. I can use the dev machine for all the python and java development, database for mysql serving and the third as a dedicated webserver.
Ubuntu packages - both data and web use the basic LAMP installation. The development server has everything - python perl php.
Add FTP and SSH.
The servers have no other interface and sftp and ssh are the best way to set up workflows and are not setup by default on ubuntu.
Install the servers and packages:
sudo apt-get install vsftpd vsftp ssh sysv-rc-conf
Edit /etc/vsftpd.conf
if you want to allow individual ftp access for your account. I turned off anonymous ftp access.
Setup subversion
For version control, if you are not Linus Torvalds, subversion is gaining in popularity. It has an easily networkable http API and some greater ease of merging.
I found all this advice on the Ubuntu Community App Board.
All hosts need this install:
apt-get install subversion
Here's the session to get the first repository added on the svn server:
sudo su
apt-get install subversion
addgroup subversion
adduser www-data subversion
adduser mylogin subversion
mkdir /svn
cd /svn
mkdir java
chown www-get.subversion java
chgrp 775 java
exit
# now check the repository out so you can add files to it
# i'm saving my .bashrc for posterity
cd # go home
mkdir svn
cd svn
svn co file:///svn/environment/
cd environment
cp ~/.bashrc .
svn add .bashrc
svn commit
Installing web access for subversion
The svn http API makes it very accessible esp for an environment like this:
The machine with the svn repository will also need to install the apache subversion module.
apt-get install libapache2-svn
Now add the following stanza to the /etc/apache2/mods-available/dav_svn.conf file:
DAV svn SVNParentPath /svn/
# path to subversion repository
AuthType Basic
AuthName "My Home subversion repository"
AuthUserFile /etc/subversion/passwd
Require valid-user
Then we have to add a user password to the /etc/subversion/passwd file:
sudo htpasswd -c /etc/subversion/passwd [your_user_name]
USING ECLIPSE with SUBCLIPSE to access your repository from anywhere
Based on this tutorial.
Download the latest version of the IDE from the eclipse.org.
The J2EE version has the Subclipse included. You'll need to install it if your copy of eclipse doesn't have it. Tigris.org has a walkthrough.
Select the SVN perspective in this menu:
Window > Open Perspective > Other... > SVN Repository Exploring.
In the SVN Repository window, right click and select "new repository location" enter in the url for your repository.
Connecting via Command Line to SVN repositories
Access the svn repository on all your unix hosts that don't have eclipse via the unix command line:
mkdir svn
cd svn
svn co svn+ssh://[username]@[svnpost]/svn/[repositoryname]
Connecting via Command Line to SVN repositories
Access the svn repository on all your unix hosts that don't have eclipse via the unix command line:
mkdir svn
cd svn
svn co svn+ssh://[username]@[svnpost]/svn/[repositoryname]
Basic Set Up for the MYSQL Server
Mysql isn't accessible to the network by default.
edit the configuration file /etc/mysql/my.cnf
where you edit this line:
bind-address = [my ip address]
restart the server:
sudo /etc/init.d/mysql restart
Full description of setting up an ubuntu LAMP stack on the ubntu boards here.
Adding VMWARE Tools
One thing you will probably want to do for the VMWare machines is to add VMWare tools, which help deal with vmware's virtual partitions and the like. The whole process is described here.
Go to the VMWare Menus: VM-> "Install VMWare Tools..."
This will mount an image with the VMWare Tools as a cdrom in /mnt/cdrom0
Since I was using Ubuntu copied the VMWare TOOLS tar file into my home directory, though there is an rpm package there if you are using them.
unpack the tar file: tar -zxvf VMWare-xxxx.tgz
go into the directory: cd vmware-tools-distrib/
install VMWare tools: by running the script: sudo ./vmware-install.pl
I only did this for the dev machine because it requires make and gcc, which wasn't good for the webserver.
in an X-friendly environment, you can run the graphical interface: vmware-toolbox &