One of the first steps when I start a new project is to define a virtual host for the project because I prefer urls in the format http://myproject.localhost over http://localhost/myproject on my local development machine.
As I currently use Apache2 for both, Rails (using mod_rails) and CakePHP, a virtual host entry in /etc/apache2/sites-available/default looks like:
<VirtualHost *:80> ServerName myproject.localhost DocumentRoot /<path_to_document_root_of_myproject> </VirtualHost>
If you have a CakePHP project, the path to the DocumentRoot is usually something like:
With Rails, on the other hand, the path to the DocumentRoot is something like:
After a restart of Apache you should get the welcome screen of the respective framework if you go to http://myproject.localhost (assuming you already “baked” the project structure and added an entry to the /etc/hosts file).