1

I have 2 Apache instances on the same server, one on port 80, one on another port. The first one works fine. When I go to mydomain.com:otherport I get the error message named in the title. The directory does exist, and has the same user and group that the web server is running as.

4
  • If you swap the ports so the working one has otherport and the non-working one has 80, does it work?
    – carl
    Mar 30, 2009 at 23:43
  • No, same problem (the working one still has the 404 error when running on port 80).
    – phpscriptcoder
    Mar 31, 2009 at 18:20
  • I tried switching it to a virtual host (just to see, I don't know if you can have a separate PHP configuration that way) and it still gives me the same error.
    – phpscriptcoder
    Mar 31, 2009 at 18:42
  • Could it have anything to do with me using mod_vhost_alias on the main domain?
    – phpscriptcoder
    Mar 31, 2009 at 19:07

2 Answers 2

3

Finally figured it out. When I added the DirectoryIndex directive, I was adding it to the main httpd.conf virtual host which I had just created, while the second server was still running off the second instance. Now I feel stupid!

For anyone else that is reading, if you are getting this error and can't figure out why, you need to add a DirectoryIndex directive.

0

You probably need to set up the http.conf for the second instance. Why are you doing it as two instances in the first place?

Two thoughts:

  • Gradually change the non-working configuration till it matches the working one (make a backup first of course) and see what change fixes it
  • Look at the error_log; if necessary, raise the logging level until you see something informative.
4
  • There is a separate httpd.conf: I am programming a control panel for use by web hosts, port 80 would be the host's main domain, the other one would be the control panel.
    – phpscriptcoder
    Mar 30, 2009 at 23:50
  • Yes, but why do you need a separate apache instance for that?
    – MarkusQ
    Mar 31, 2009 at 2:54
  • It needs to have none of the restrictions on PHP that the main domain must have (to prevent people from hacking the server).
    – phpscriptcoder
    Mar 31, 2009 at 18:15
  • Here is the error: Attempt to serve directory: /path/to/document/root A site I found suggested adding an index.html file. It didn't work, even after adding a DirectoryIndex directive. I can access the index file I created by going to domain.com:port/index.html, but not domain.com:port.
    – phpscriptcoder
    Mar 31, 2009 at 20:15