I have created files for my site in the /home/junda/www/ directory. I use symfony2, means the public files goes to /home/junda/www/symfony2-tries/web/ directory.

I then type this following command to the terminal to change permission:

sudo chmod -R a+rX ~/www
sudo chmod a+rx ~

I also create /etc/apache2/sites-available/symfony2-tries.com file with following content:

# domain: symfony2-tries.com
# public: /home/junda/www/symfony2-tries.com/

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin webmaster@symfony2-tries.com
  ServerName  www.symfony2-tries.com
  ServerAlias symfony2-tries.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex app.php
  DocumentRoot /home/junda/www/symfony2-tries/web

  # Custom log file locations
  LogLevel warn
  ErrorLog  /home/junda/www/symfony2-tries/log/error.log
  CustomLog /home/junda/www/symfony2-tries/log/access.log combined


after that i tried to enable it using a2ensite.

sudo a2ensite symfony2-tries

but it returns:

ERROR: Site symfony2-tries.com does not exist!

Could anyone kindly told me where I did wrong? And if possible, how to correct it. Thank You very much.


I have found the solution!

All files in /etc/apache2/sites-available/ must have the .conf extension now.

Example: symfony2-tries rename it in symfony2-tries.conf

Type sudo a2ensite symfony2-tries.conf and restart apache.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.