On my local Windows LAMP Dev server, I set up test sites with the domains like this...
http://projectName.dev
http://www.projectName.dev
I then have a simple program that also adds the appropriate records to my Windows HOSTS
file...
127.0.0.1 projectName.dev
127.0.0.1 www.projectName.dev
The magic happens with my Apache vHosts
file...
Using the settings below in my Apache config file...
NameVirtualHost *:80
<VirtualHost *:80>
VirtualDocumentRoot E:/Server/htdocs/projects/%-2/www
ServerName staging.dev
ServerAlias *.dev www.*.dev
</VirtualHost>
This all works great on my Local Windows Dev Server. So now this folder...
E:/Server/htdocs/projects/
holds all my main projects that deserved having there own domain on my Dev server. The way I have it set up, all the web accessible content that Apache servers lives in the www
folder inside of the domains project folder.
So looking at this folder E:/Server/htdocs/projects/projectName/
there is 1 folder which is the www
folder. This works out great because it makes it easy for me to save other project related files in this root folder, like Client information files or custom PSD image files, or just anything related to that project that I do not want to be part of that projects website.
What I would also like to add to this folder now is other things like Log files
that Apache creates. I think this folder would be a perfect spot for those files... E:/Server/htdocs/projects/projectName/logs
So I attempted to add something like this below to my vHosts file with no luck. The result is Apache will not boot up once I add this code below.
Could someone help to to set this properly? Also do you know if there's a simple solution to also have like PHP log any errors or such to these appropriate project level log folders?
Testing to set up Log paths...
NameVirtualHost *:80
<VirtualHost *:80>
VirtualDocumentRoot E:/Server/htdocs/projects/%-2/www
ServerName staging.dev
ServerAlias *.dev www.*.dev
ErrorLog "E:/Server/htdocs/projects/%-2/logs/error.log"
CustomLog "E:/Server/htdocs/projects/%-2/logs/access.log" common
</VirtualHost>
0 Answers