Virtualhosts won't work (Chrome says "Ooops! Could not...")

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Virtualhosts won't work (Chrome says "Ooops! Could not...")

Postby alexstarbuck » 02. March 2014 23:23

Hello everyone,

my first post so please be gentle :). I'm just learning about web development and am already struggling with just the basics set-up.

MacBook Air
OSX 10.8.2
XAMPP 1.8.3-2
Firefox, Chrome, Safari, all the latest versions.

Everything seems to work when I use "htdocs" as root folder to test my php code (EXTREMELY basic level still). Quickly I learned that this way I can only have one site (and one index.php file which loads on entering "localhost" if I'm not mistaken). I decided to change this as I learned about VirtualHosts feature and changed the directory where Apache looks for files.

1. I edited httpd.conf file
2. then httpd-vhosts.conf file
3. and finally hosts.
4. restarted apache
5. started Chrome, in address bar I wrote: localhost - nothing. "Oops! Google Chrome could not find localhost" I also tried http://probniphp.local - "Oops! Google Chrome could not find localhost"

Any idea what went wrong? Below is the code I tinkered with:

httpd.conf file

Code: Select all
DocumentRoot "/Users/EdChigliak/Websites"
<Directory "/Users/EdChigliak/Websites">


httpd-vhosts.conf (commented out 2 dummy hosts and added my custom one) file

Code: Select all
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error_log"
# CustomLog "logs/dummy-host.example.com-access_log" common
#</VirtualHost>

#<VirtualHost *:80>
#ServerAdmin webmaster@dummy-host2.example.com
#DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host2.example.com"
#ServerName dummy-host2.example.com
#ErrorLog "logs/dummy-host2.example.com-error_log"
#CustomLog "logs/dummy-host2.example.com-access_log" common
#</VirtualHost>
#localhost

<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/htdocs"
<Directory "/Applications/XAMPP/htdocs">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
</VirtualHost>

# My custom host
<VirtualHost *:80>
ServerName probniphp.local
DocumentRoot "/Users/EdChigliak/Websites/probniphp"
<Directory "/Users/EdChigliak/Websites/probniphp">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
ErrorLog "logs/mysite.local-error_log"
</VirtualHost>


hosts file

Code: Select all
#Virtual Hosts 127.0.0.1 probniphp.local


Thank you all in advance!
--
Either we find a way or we make one! -Hanibal
User avatar
alexstarbuck
 
Posts: 9
Joined: 02. March 2014 23:03
Location: Croatia
Operating System: OSX 10.8.2

Re: Virtualhosts won't work (Chrome says "Ooops! Could not..

Postby JJ_Tagy » 03. March 2014 04:03

alexstarbuck wrote:hosts file
Code: Select all
#Virtual Hosts 127.0.0.1 probniphp.local


If this is truly how your hosts file looks, you will have problems. The # will comment out the entire line making it invisible to the OS. I will have to double check OSX, but definitely Windows would have that problem.
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: Virtualhosts won't work (Chrome says "Ooops! Could not..

Postby alexstarbuck » 03. March 2014 10:36

Taggy thank you for the reply! :)

I'm sorry, im still new to the forum so I am probably not using all the features correctly - I should have put it on a separate line. Pound sign "#" is in front of Virtual hosts but 127.0.0.1 and the rest is on a separate line so there shouldn't be any problem

Do you know what else could be an issue?
--
Either we find a way or we make one! -Hanibal
User avatar
alexstarbuck
 
Posts: 9
Joined: 02. March 2014 23:03
Location: Croatia
Operating System: OSX 10.8.2

Re: Virtualhosts won't work (Chrome says "Ooops! Could not..

Postby Nobbie » 03. March 2014 12:47

Probably your Apache did not start or did not recognize the VirtualHosts, due to an error. Look into the error log, it should tell you what has gone wrong.
Nobbie
 
Posts: 8780
Joined: 09. March 2008 13:04

Re: Virtualhosts won't work (Chrome says "Ooops! Could not..

Postby alexstarbuck » 03. March 2014 15:29

This is what the log says (I cleared all old messages so this is from today, after I re-did all the changes in config files):

Mon Mar 03 15:26:04.032304 2014] [ssl:warn] [pid 44382] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Mar 03 15:26:04.032515 2014] [ssl:warn] [pid 44382] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Mon Mar 03 15:26:04.034604 2014] [suexec:notice] [pid 44382] AH01232: suEXEC mechanism enabled (wrapper: /Applications/XAMPP/xamppfiles/bin/suexec)
[Mon Mar 03 15:26:05.060928 2014] [lbmethod_heartbeat:notice] [pid 44383] AH02282: No slotmem from mod_heartmonitor
[Mon Mar 03 15:26:06.000761 2014] [auth_digest:notice] [pid 44383] AH01757: generating secret for digest authentication ...
[Mon Mar 03 15:26:06.069970 2014] [ssl:warn] [pid 44383] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Mar 03 15:26:06.070016 2014] [ssl:warn] [pid 44383] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Mon Mar 03 15:26:06.072677 2014] [mpm_prefork:notice] [pid 44383] AH00163: Apache/2.4.7 (Unix) PHP/5.5.6 OpenSSL/1.0.1e mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Mon Mar 03 15:26:06.072741 2014] [core:notice] [pid 44383] AH00094: Command line: '/Applications/XAMPP/xamppfiles/bin/httpd -E /Applications/XAMPP/xamppfiles/logs/error_log -D SSL -D PHP'


I can't make any sense from this as I only understand some basics so any help is appreciated
--
Either we find a way or we make one! -Hanibal
User avatar
alexstarbuck
 
Posts: 9
Joined: 02. March 2014 23:03
Location: Croatia
Operating System: OSX 10.8.2

Re: Virtualhosts won't work (Chrome says "Ooops! Could not..

Postby alexstarbuck » 03. March 2014 16:06

Ummm.... now I think I've messed it all up and am thinking of de-installing and re-installing XAMPP. Isnt there a simpler solution to get the whole thing working?
--
Either we find a way or we make one! -Hanibal
User avatar
alexstarbuck
 
Posts: 9
Joined: 02. March 2014 23:03
Location: Croatia
Operating System: OSX 10.8.2


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 3 guests