you can also have a look at 
http://www.sfblog.fr/page/symfony-et-les-vhost-dynamique
it's in french but the apache configuration should be enough to
understand.


On Sep 19, 3:55 am, kp <krispeel...@gmail.com> wrote:
> Sounds like what you are doing is correct, and it's the way I do it
> (for local machine development).  I create a separate vhost for each
> Symfony site, tweak the paths, and add an entry to my hosts file.
>
> If each each project has a lib/vendor/symfony folder you can run
> different versions of Symfony on your machine.
>
> You can also create separate vhosts for each of your apps within a
> project.  Create sub-directories under /web for each app, move the
> front controller files into them, along with the css and images
> folders or any other assets, and then tweak your vhost paths.
>
> example:
>
> <VirtualHost *:80>
>
>         ServerAdmin y...@example.com
>         ServerName      local.site
>
>         DocumentRoot    /var/www/project/web/frontend
>
>         DirectoryIndex index.php
>
>         Alias /sf "/var/www/project/lib/vendor/symfony/data/web/sf"
>
>         ErrorDocument 400 /index.php/errors/error404
>         ErrorDocument 401 /index.php/errors/error404
>         ErrorDocument 403 /index.php/errors/error404
>         ErrorDocument 404 /index.php/errors/error404
>
>         <Directory "/var/www/project/lib/vendor/symfony/data/web/sf">
>           AllowOverride All
>           Allow from All
>         </Directory>
>
>         <Directory "/var/www/project/web/frontend">
>           AllowOverride All
>           Allow from All
>         </Directory>
>
> </VirtualHost>
>
> Or if your apps share a lot of the same assets, keep all your common
> files under /web and create aliases that point to them like this:
>
>         Alias /css "/var/www/project/web/css"
>         Alias /images "/var/www/project/web/images"
>
> Kris
>
> On Sep 18, 3:48 am, Davide Borsatto <lloy...@gmail.com> wrote:
>
> > Hi everybody,
>
> > Lately I've been doing many experiments with symfony, creating
> > differents projects for each of them.
> > I usually create an apache dedicated virtual host, with a defined
> > server name, link to the web/ directory of symfony, and add a row to
> > the /etc/hosts file to match the new server name.
>
> > I'm sure this is not the best way to achieve the result...
>
> > Indeed, I was thinking that it would be cool to reach multiple symfony
> > projects with url like
>
> >http://project1.localhost/http://project2.localhost/
>
> > Where Apache understands that project1 is a directory, and builds the
> > path like this
>
> > /var/www/symfony_projects/:project/web
>
> > So I could simply create a new directory with a symfony project
> > inside, and it would be ready to go.
>
> > My point is: is there any way to configure Apache to make this happen?
> > And the file /etc/hosts supports "wildcard hosts"?
>
> > I'm a PHP programmer, and I'm not familiar with the Apache
> > configuration. I simply copy and paste the virtual host file and
> > change a few things to match this or that directory.
>
> > I'd really love to set up Apache this way, hope you guys can help.
> > Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to