I have a development machine with lamp setup. Now to add virtual hosts this is what I do currently:
- add a virtual host file
<virtualhost> ... </virtualhost>in the /etc/apache2/sites-available - add the virtual host using
sudo a2ensite <host-file> - sudo service apache2 restart
This works fine and I get the desired site up and running on my localhost.
Now the problem is that every time I have to make some change to the configuration file for a site, I have to sudo to edit the configuration file.
What I was wondering is if it is possible to specify some directory in my home folder where apache can look for configuration files for the sites instead of the default sites-enabled directory.
sudoto edit the config files? The latter is because of file permissions for security reasons. If it's a development machine, and you're not concerned with file system security, then you can just change the permissions so you don't need to usesudo. If you just want easier access to thesites-availablefolder, then just create a symbolic link. – Lèse majesté Dec 26 '11 at 14:04