-1

I do not use a cache and still I get the same error in the dev enviroment.

I have three different projects that I want to run locally (dev pc Ubuntu) for development. Does anyone have a tip for me, how do I configure the vhosts or projects?

Thanks fralex

  • Vhosts for apache can be added individually and define the appropriate parameters for each host within each file, e.g. the document root and the hostname that should be expected, e.g. dev1.localhost, dev2.localhost etc. You can store them in /etc/httpd/conf/vhosts/eachvhosthere.conf - ensure they are .conf extensions. Check syntax using `httpd -t` in console. Suggest you Google how to use vhosts in apache. – scrowler Dec 09 '14 at 09:40

1 Answers1

0

Here is an example of Symfony2's vhost for the lastest versions of Apache (set one for each of your sites):

# /etc/apache2/sites-available/my-app.conf

<VirtualHost *:80>
    ServerName my-app.local.fr
    DocumentRoot /home/me/Workspace/MySymfonyApp/web

    <Directory /home/me/Workspace/MySymfonyApp/web>
            Options Includes FollowSymlinks
            AllowOverride none
            Require all granted
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app.php [QSA,L]
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/my_app_error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/my_app_access.log vhost_combined
</VirtualHost>

Active it with the command:

$ sudo a2ensite my-app

And reload Apache's service:

$ sudo service apache2 reload

Do not forget to active url rewriting (you have to do this only once, not for all vhosts)!

$ sudo a2enmod rewrite
$ sudo service apache2 restart
Gnucki
  • 5,043
  • 2
  • 29
  • 44