Question

I am kind of stuck. I dont get my local machine ready for development because I fail to get my vHost config working. I just cant access my document root with a browser (connection failes. Can connect to server).

Details:

OS: OSX 10.9.2
Apache/2.2.26

The vHost config looks like this:

<VirtualHost *:80>
  ServerAdmin me@something.com
  ServerName something.loc
  ServerAlias *.someting.loc
  UseCanonicalName Off
  VirtualDocumentRoot /path/to/vhosts/%2/%1/htdocs
  <IfModule dir_module>
        DirectoryIndex index.php index.html
  </IfModule>
  <FilesMatch "\.js\.gzip$">
        AddType "text/javascript" .js.gzip
  </FilesMatch>
  <FilesMatch "\.css\.gzip$">
        AddType "text/css" .css.gzip
  </FilesMatch>
  AddEncoding x-gzip .gzip
  <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/plain text/html
  </IfModule>
</virtualHost>

In /path/to/vhosts/test/dev/htdocs I have a simple index.html, that says Hello World!. The Host that should match this folder is dev.test.something.loc, which I included in my /etc/hosts:

127.0.0.1   dev.test.something.loc

The mod_vhost_alias apache module ist loaded:

LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so

So I cant access the index.html via browser, but I dont get anything in an apache error.log when trying. So lets try with wget:

$ wget dev.test.something.loc
--2014-04-05 10:12:40--  http://dev.test.something.loc/
Resolving dev.test.something.loc... 127.0.0.1
Connecting to dev.test.something.loc|127.0.0.1|:80... failed: Connection refused.

Ok, not working. Next approach:

wget --header="Host: dev.test.something.loc" -O - http://localhost
--2014-04-05 10:14:53--  http://localhost/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67 [text/html]
Saving to: 'STDOUT'

 0% [                         ] 0           --.-K/s              <html>
<head>
</head>
<body>
<h1>Hello World!</h1>
</body>

</html>
100%[============================>] 67          --.-K/s   in 0s

2014-04-05 10:14:53 (5.32 MB/s) - written to stdout [67/67]

Look, thats my index.html! Lets try 127.0.0.1 instead of localhost:

wget --header="Host: dev.test.something.loc" -O - 127.0.0.1
--2014-04-05 10:17:24--  http://127.0.01/
Resolving 127.0.0.1... 127.0.0.1
Connecting to 127.0.0.1|127.0.0.1|:80... failed: Connection refused.

That is all I got so far. Something is obviously wrong. But I am not familiar enough with the whole apache config thing, that I can figgure ot by myself what it is I am missing. Maybe somebody can provide helpful suggestions?

Thanks in advance.

Was it helpful?

Solution

I still dont know what the problem was, but formating the SSD and starting with a fresh OS X from scratch did the job. The very same config worked like a charm. Closing the question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top