Development web server, domain setup
Thursday, June 7th, 2007I have a development server on my local network that runs Symfony. When starting a new project, I add a new virtual host configuration to Apache and an entry in Windows’ Hosts file. The entries are similar to the following.
On my Ubuntu box, in /etc/apache2/apache2.conf add
<VirtualHost *>
ServerName PROJECTNAME
DocumentRoot "/var/www/PROJECTNAME/web"
DirectoryIndex index.php
Alias /sf /usr/share/php/data/symfony/web/sf
<Directory "/var/www/PROJECTNAME/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
On my Windows machine, in C:\WINDOWS\system32\drivers\etc\hosts add
192.168.SERVERIPADDRESS PROJECTNAME
This will allow me to type the URL PROJECTNAME into my browsers address bar. The biggest benefit of this is the similarity between relative paths for my development sever and my production server.
