At my work, we just installed a development server that will host the demo of the work of the web developers. I’ll explain here how I managed to do that.
First of all, install your box. I choose Ubuntu server my employer loves everything that is trendy. If I prefer Gentoo, Ubuntu is probably more convenient for most users.
The power of Ubuntu Server is that you can directly install a LAMP server. Here we’ll need some extra packages for Trac and Subversion.
sudo apt-get install trac libapache2-svn libapache2-mod-python
The idea is to have for a project a virtual host, a Subversion repository and a Trac.
I’ve choose this directory structure:
~/projects/ .htpasswd (Password file) project_name/ apache.conf (Apache configuration file) log/ (Apache logs) svn/ (Subversion repository) trac/ (Trac) www/ (VirtualHost document root)
For the better flexibility and don’t deal with a DNS server. Every project will be mapped on a port.
Here is a Python script that will create for you this structure.
All you need is to create the directory projects
and
.htpasswd
in it, then run :
python create_project.py project_name port
An example:
-
Create your project called “test” and mapped on the port 8000.
python create_project.py test 8000
-
Install it in Apache.
sudo ln -s /home/`whoami`/projects/test/apache.conf /etc/apache2/sites-enabled/test
-
Restart Apache to see the change
sudo /etc/init.d/apache2 restart
-
Open you browser and visit:
http://your-server-ip:8000/
http://your-server-ip/svn/test/
http://your-server-ip/trac/test/
For a very convenient server, I suggest you to use ssh for everybody. They
just have to give you their public key, you add it into .ssh/authorized_keys
and then they can log in safely for SCP, SFTP (need to configure the FTP
server) or remote control.
Feel free to give me feedback about your experience, this script is in a early stage of development use it at your own risk.