views:

1867

answers:

3

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.

A: 

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.
MarkusQ
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.
Yes, but why do you need a separate apache instance for that?
MarkusQ
It needs to have none of the restrictions on PHP that the main domain must have (to prevent people from hacking the server).
Ah. Makes sense.
MarkusQ
Here is the error: Attempt to serve directory: /path/to/document/rootA 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 http://domain.com:port/index.html, but not http://domain.com:port.
A: 

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.

A: 

I had already restarted apache several times using apache2ctl restart, which did not update the settings, but trying apache2ctl stop and then apache2ctl start worked. No idea why!