Koozali.org: home of the SME Server

My httpd is broken

Sterling

My httpd is broken
« on: October 24, 2002, 08:34:00 PM »
I've replied to the thread related to this but I didn't see the message come up to the top so I am starting a new thread on this. Please forgive me for the double post.

I'm having a problem I can't seem to solve. I was looking for info on how to change my default index file in apache. I followed these directions I found on this forum:

  ----------
  #mcedit /etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00
  or
  #mcedit /etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00PHP
  Now if you want to make mods to httpd.conf you need to do something like this:
  #mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
  #mcedit /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/50DirectoryDefault00
  and add the following line
  DirectoryDefault default.htm default.html default.shtml default.cgi
  Save and expand the template with
  #/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  If you have a look in /etc/httpd/conf/httpd.conf you should now see your new custom settings.
  ----------

Now I am having this problem. My httpd.conf keeps getting rebuilt with the DirectoryDefault command even though I've deleted the /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/50DirectoryDefault00 file and expanded the template again. This DirectoryDefault command causes httpd not to start:

  ----------
  [root@cowley httpd.conf]# service httpd restart
  Stopping httpd: [ OK ]
  Starting httpd: Syntax error on line 375 of /etc/httpd/conf/httpd.conf:
  Invalid command 'DirectoryDefault', perhaps mis-spelled or defined by a module not included in the server   configuration
  [ FAILED ]
  ----------

I can go manually delete the command out of /etc/httpd/conf/httpd.conf but it gets rebuilt a few minutes later httpd stops and won't start again. I can't figure out for the life of me where the DirectoryDefault command it is coming from. I've had to make /etc/httpd/conf/httpd.conf unwritable to keep my admin and web server running. Can somebody please give me a hint?

Thanks in advance,
Sterling

Bill Talcott

Re: My httpd is broken
« Reply #1 on: October 24, 2002, 09:12:47 PM »
Sterling wrote:
>
>   #mcedit
> /etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00
>   or
>   #mcedit
> /etc/e-smith/templates/etc/httpd/conf/httpd.conf/50DirectoryIndex00PHP

You didn't accidentally save the modifications over the original templates, did you?

Nathan Fowler

Re: My httpd is broken
« Reply #2 on: October 24, 2002, 09:14:15 PM »
This will give you the filename where DefaultDirectory is found in the file:
cd /home/e-smith/files/templates-custom/etc/httpd/conf/httpd.conf
grep -i -H "DefaultDirectory" *

Try the same for:
cd /home/e-smith/files/templates/etc/httpd/conf/httpd.conf
grep -i -H "DefaultDirectory" *

Make sure you remove all entries containing "DirectoryDefault".

Also note that "DirectoryDefault" should read as "DirectoryIndex".  HTTP is hosing because DirectoryDeafult is not a valid HTTP directive.  Replacing DirectoryIndex with DirectoryDefault should produce the desired effect.

[DirectoryIndex directives ]
Allows you to say DirectoryIndex index.html index.cgi, which instructs the server to either send back index.html or run index.cgi when a directory URL is requested, whichever it finds in the directory.

Example:
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
DirectoryIndex index.htm index.html index.shtml index.cgi
DirectoryIndex index.htm index.html index.shtml index.cgi index.php index.php3

The template you want to modify would be:
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/50DirectoryIndex00DFT

Add the lines:
DirectoryIndex default.htm default.html default.shtml default.cgi
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

If you have a look in /etc/httpd/conf/httpd.conf you should now see your new custom settings.

Evidently the author of the "DefaultDirectory" material was incorrect.  The correct directive is DefaultIndex.

If I can be of further assistance let me know.

Hope this helped,
Nathan

Nathan Fowler

Re: My httpd is broken
« Reply #3 on: October 24, 2002, 09:15:44 PM »
Add the lines:
DirectoryIndex default.htm default.html default.shtml default.cgi
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf


Should read as:

Add the lines:
DirectoryIndex default.htm default.html default.shtml default.cgi
[Save the file]

Expand the template:
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

Restart HTTPD:
/etc/rc.d/init.d/httpd restart

Nathan

Sterling

Re: My httpd is broken
« Reply #4 on: October 26, 2002, 01:56:37 AM »
Thanks for your help. I don't have
/home/e-smith/files/templates-custom/etc/httpd/conf/httpd.conf
or
/home/e-smith/files/templates/etc/httpd/conf/httpd.conf
at all on my system (5.5). I also don't have DirectoryDefault anywhere in /etc/e-smith/ (I did 'grep -i -H -r "DefaultDirectory" /etc/*' and nothing came up)

I have now had 'grep -i -H -r "DefaultDirectory" /*' running for 24 hours. It hasn't returned anything useful and it's still hasn't returned to the # prompt (still running or stuck I guess).

Any other ideas?

Thanks again,
Sterling

Nathan Fowler

Re: My httpd is broken
« Reply #5 on: October 26, 2002, 03:13:51 AM »
Sorry, I typod, the templates live in:

/etc/e-smith/templates

not:
/home/e-smith/files/templates

Sorry about that.

Sterling

Re: My httpd is broken
« Reply #6 on: October 26, 2002, 03:17:43 AM »
Not a problem :) I checked both places. It's hiding on me somewhere and I still can't find it. I'll keep looking. Let me know if you have any other ideas.

Thanks,
Sterling