index.php files ignored

Ryan Schmidt ryandesign at macports.org
Sat Mar 19 15:16:41 PDT 2011


Let's keep the discussion on the mailing list, so all can benefit from it. (Use Reply All when you reply.)


On Mar 19, 2011, at 11:52, Tony Miller wrote:

> On Mar 19, 2011, at 2:08 AM, Ryan Schmidt wrote:
> 
>> On Mar 18, 2011, at 13:08, Tony Miller wrote:
>> 
>>> If I try to load the site using the DNS name for the site, ex: http://www.mysite.com/ it fails to acknowledge there is an index.php file in the root of the directory and redirects to the default site for the apache server.
>> 
>> It redirects?
>> What *exactly* does the server return? what headers? In the Terminal, do this:
>> 
>> curl -I http://www.mysite.com/
>> 
>> (P.S: capital I, not lowercase l)
> 
> I guess 'redirect' is the wrong term. It is really just going to the default virtual host on the server because it is not finding the index.php file. 

I agree it's probably using a different virtual host, but not because it's not finding the index.php file. Virtual hosts are independent environments. Apache does not decide, when it cannot find a file in one virtual host, to go looking for it in another.


> web5:leopoldheritage systems$ ls -ls
> total 56
> 8 -rwxrwxr-x   1 systems  _www  2073 Mar  9 20:43 INSTALL
> 8 -rwxrwxr-x   1 systems  _www  1085 Mar  9 20:43 LICENSE.TXT
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:42 blocks
> 0 drwxrwxr-x  22 systems  _www   748 Mar  9 20:42 concrete
> 0 drwxrwxr-x   4 systems  _www   136 Mar  9 20:42 config
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:42 controllers
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:42 css
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:42 elements
> 0 drwxrwxr-x  15 systems  _www   510 Mar  9 20:43 files
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 helpers
> 8 -rw-r--r--@  1 systems  _www   122 Mar 14 10:03 index.html
> 8 -rw-r--r--@  1 systems  _www    42 Mar 18 16:35 index.php
> 8 -rwxrwxr-x@  1 systems  _www    42 Mar 18 16:34 indexnot.php
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 jobs
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 js
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 languages
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 libraries
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 mail
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 models
> 0 drwxrwxr-x  12 systems  _www   408 Mar  9 20:43 packages
> 8 -rw-rw-r--   1 systems  _www   269 Feb 27 21:22 phplocal.php
> 8 -rwxrwxr-x   1 systems  _www   347 Mar  9 20:43 robots.txt
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 single_pages
> 0 -rwxrwxr-x   1 systems  _www     0 Mar  9 20:43 sitemap.xml
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 themes
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 tools
> 0 drwxrwxr-x   2 systems  _www    68 Mar  9 20:43 updates

What is the full path to this directory?


> web5:leopoldheritage systems$ curl -I http://www5.leopoldheritage.org
> HTTP/1.1 200 OK
> Date: Sat, 19 Mar 2011 16:49:02 GMT
> Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d DAV/2 PHP/5.3.5
> Last-Modified: Mon, 07 Mar 2011 21:08:19 GMT
> ETag: "8f-49deae52296c0"
> Accept-Ranges: bytes
> Content-Length: 143
> Content-Type: text/html
> 
> web5:leopoldheritage systems$ curl -I http://www5.leopoldheritage.org/index.php
> HTTP/1.1 404 Not Found
> Date: Sat, 19 Mar 2011 16:49:20 GMT
> Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d DAV/2 PHP/5.3.5
> Content-Type: text/html; charset=iso-8859-1
> 
> The file is clearly in the directory, but it doesn't find it. 

I guess the virtual host is not set up correctly. Could you show the Apache virtual host definition for www5.leopoldheritage.org?




More information about the macports-users mailing list