Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: Sterling 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
-
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?
-
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
-
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
-
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
-
Sorry, I typod, the templates live in:
/etc/e-smith/templates
not:
/home/e-smith/files/templates
Sorry about that.
-
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