I'm working on Windows XP.
I need the batch file to do the following:
- Create a directory $DOMAINNAME on D:/Webserver/domains/%DOMAINNAME/www/
- Open the file - D:/Webserver/apache2/conf/extra/httpd-vhosts.conf
Append the following to that file:
<VirtualHost *:1337> DocumentRoot "D:/Webserver/domains/$DOMAINNAME/www" ServerName "$DOMAINNAME" ServerAlias "$DOMAINNAME" ErrorLog "logs/$DOMAINNAME-error.log" CustomLog "logs/$DOMAINNAME-access.log" common <Directory "D:/Webserver/domains/$DOMAINNAME"> Allow From all AllowOverride All </Directory> </VirtualHost>
Open the file - C:/WINDOWS/sysstem32/drivers/etc/hosts
- Append this to that file:
127.0.0.1 $DOMAINNAME
- Close the files.
I do this manually but it's tiring. Please help.