pcs800 wrote:And to be clear, you want me to stop the apache service, switch to the new httpd-vhosts.conf and then kill any instance of apache, httpd and mysql in task manager, uncheck SVC on the xampp control panel for apache and mysql, then start them via the control panel?
No need to worry about this now as I have spotted the culprit causing your problems.
Problem solved.You are using a non text editor to edit your conf files and this has caused an issue with the quote marks
“ ” not being recognised by Apache in the httpd-vhost.conf file.
They should look like this if you had used a text editor like notepad etc.
" " - can you spot the difference?
I picked this up when I copied my code which contained some copy and paste of your own very first posted code and entered it into a 1.6.3a version I have for testing and Apache failed to start with a system error not an Apache error which gave me the clue - I should not copy and paste other peoples code.
Here is the code copy and pasted from your very first post
<VirtualHost 127.0.0.1>
ServerName
http://www.site1.comDocumentRoot
“C:/xampp/htdocs/site1folder
”ErrorLog
“C:/xampp/htdocs/site1folder/errorlog
”DirectoryIndex index.html index.php index.html
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerName
http://www.site2.comDocumentRoot
“C:/xampp/htdocs/site2folder
”ErrorLog
“C:/xampp/htdocs/site2folder/errorlog
”DirectoryIndex index.html index.php index.html
</VirtualHost>
So to correct this simply use a text editor like notepad not a word processor like word or wordpad when editing any conf or ini files in XAMPP.
I have corrected the code here which all you need do is copy and paste over to your httpd-vhosts.conf file, save the file and restart Apache.
- Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName site1.com
ServerAlias www.site1.com
DocumentRoot "C:/xampp/htdocs/site1folder"
ErrorLog "C:/xampp/htdocs/site1folder/error.log"
DirectoryIndex index.html index.php index.htm
</VirtualHost>
<VirtualHost *:80>
ServerName site2.com
ServerAlias www.sire2.com
DocumentRoot "C:/xampp/htdocs/site2folder"
ErrorLog "C:/xampp/htdocs/site2folder/error.log"
DirectoryIndex index.html index.php index.htm
</VirtualHost>
I have just tested all this in 1.6.3a exactly as you should now have it configured and Apache starts and the site1.com and site2.com as well as localhost work perfectly - you should also see the error.log file created in your site folders after you have started Apache.
The apache -S command gave a Syntax OK indication
- Code: Select all
F:\xampp\apache\bin>apache -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 localhost (C:/xampp/apache/conf/extra/httpd-ssl.conf:74)
*:80 is a NameVirtualHost
default server localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:46)
port 80 namevhost localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:46)
port 80 namevhost site1.com (C:/xampp/apache/conf/extra/httpd-vhosts.conf:51)
port 80 namevhost site2.com (C:/xampp/apache/conf/extra/httpd-vhosts.conf:59)
Syntax OK
C:\xampp\apache\bin>
Good luck and best wishes.