Getting an Apache (httpd) server up and running (YDL 3.0.1)

Longman, Bill longman at sharplabs.com
Mon Sep 27 12:12:42 MDT 2004


> I've also put files in the /var/www/html directory that I 
> ftped from my OS X 
> server and they don't work (see below for changed permissions).
> 
> /etc/httpd/logs/error_log says error (13) file permissions 
> don't allow file 
> to be served (I'm paraphrasing from memory here). This is 
> AFTER I have run 
> "chown -R root:root /var/www/html" (since the one file that works is 
> root:root) and "chmod --reference=o.html other.html" on a few 
> of them (I 
> used --reference since o.html was working and I figured I 
> could "borrow" the 
> permissions from the one file of mine that worked).
> 
> Come to think of it, is it possible that my "chown -R 
> root:root /html" is 
> what prevents the files from being served? Should the owner 
> of var/www/html 
> be something else (did that chown change the html directory?)?

Bingo! Error 13 is *the* indicator that your permissions are wrong. You are
assuming that the process that needs to read the HTML files is a root
process. You can't assume that. Just run ps and see who owns the httpd pid.
That's the ID you need to change the HTML files to. It's probably either
apache or nobody. You can also find this information in the
/etc/apache/conf/httpd.conf file. There are lines for user and group of the
httpd process. That file is your friend.

> I also get another error that has to do with 
> /var/run/httpd.pid... something 
> like Error (17) "/var/run/httpd.pid overwritten -- Unclean 
> shutdown of 
> previous Apache run?
> 
> This happens when I try to restart httpd (using the GNOME 
> network services 
> interface) after changing something in HTTP and writing it to 
> the httpd.conf 
> file.
> 
> When this happens httpd is not running as shown by a ps -e|grep httpd
> 
> Questions:
> 
> 1. Are there any utilities out there that will allow for a cleaner (& 
> easier) set up of Apache on YDL for httpd (& WebDAV but 
> that's for a later 
> project... right now I'd like plain http working) than what 
> I'm using (GNOME 
> HTTP and the GNOME server start/stop/restart application and 
> chown/chmod to 
> change ownerships)?
> 
> 2. What do I have to do to get a plain-Jane http server 
> working on YDL? 
> Should I do a clean reinstall?
> 
> 3. Are there any primers -- I haven't had much luck with the 
> YDL one (e.g. a 
> more-or-less step-by-step guide that doesn't assume a whole lot of 
> knowledge) on how to get httpd running (on YDL/Red Hat)?

The Apache documentation is massive, but it's quite thorough. Find it at
apache.org.
 
> 4. Where are the files to be served stored? I thought it was 
> var/www/html 
> (at least that's what's in httpd.conf and that's where I've 
> put o.html) I 
> also presume there's the same functionality as on OS X to 
> have ~username 
> (since it too runs Apache).

You can define this in httpd.conf. There's a line for where the html files
live. It's called DocumentRoot. It's usually /var/www/html but your conf
file is the boss.


More information about the yellowdog-newbie mailing list