Click to See Complete Forum and Search --> : HTML pages not displayed in Apache


programmer_83
04-05-2004, 01:42 PM
i have installed apache on /home/alex/apache. i can see the apache test page when i type, http://localhost. but, when i save a page myfirst.html in the htdocs folder and type http://localhost/myfirst.html, i receive the "object not found" error message. should i have to configure apache to display html files or some other thing.

any help appreciated.
thankz.

mdwatts
04-05-2004, 01:45 PM
Does 'myfirst.html' open and display properly if you open directly in the browser with 'File/Open File' and then browse to myfirst.html?

programmer_83
04-05-2004, 01:49 PM
yes, it displays in mozilla browser. i have installed red had linux 8.0 in my system.

Choozo
04-05-2004, 01:52 PM
I would guess that the testpage you see is the one from the (most likely) previously installed apache - the one that got installed when you installed your distro.
This means that you also should have a 'httpd.conf' file somewhere (most likely: /etc/httpd/httpd.conf) that have a DocumentRoot already set - /var/www/html/ is a good guess here.

BTW, any reason for installing the apache server itself in your home directory?

mdwatts
04-05-2004, 01:54 PM
Is 'DocumentRoot' in httpd.conf set to the same directory as myfirst.html resides in?

i.e. from my httpd.conf

DocumentRoot "/srv/www/htdocs"

Try specifying ServerName (also in httpd.conf) and myfirst.html.

Mine would be

ServerName mdw4.mdwsystems.net

http://mdw4.mdwsystems.net/myfirst.html

programmer_83
04-05-2004, 02:00 PM
Originally posted by Choozo
BTW, any reason for installing the apache server itself in your home directory?

I am a newbie to linux and tried to install a prg by compiling, making, etc.is it wrong to install apache on the /home directory?

Choozo
04-05-2004, 02:15 PM
Originally posted by programmer_83
I am a newbie to linux and tried to install a prg by compiling, making, etc.is it wrong to install apache on the /home directory? Its certainly not normal procedure, and as I mentioned - Apache is most likely already installed on your system.

You need to find out if a program you are going to install already exist:
rpm -aq | grep <programname here> would tell you so (on an RPM based distro like RedHat).

programmer_83
04-05-2004, 02:40 PM
Originally posted by Choozo
You need to find out if a program you are going to install already exist:
rpm -aq | grep <programname here> would tell you so (on an RPM based distro like RedHat).

ok. thank you. but, wat programname should i give to check for the apache server and other programs?

andycrofts
04-05-2004, 02:41 PM
..could your apache (being in Home dir.) not be permitted access to /var/www/html?
Just a shot in the dark....
-Andy

Choozo
04-05-2004, 02:58 PM
Originally posted by programmer_83
ok. thank you. but, wat programname should i give to check for the apache server and other programs? How hard can this be?
rpm -aq | grep apache
rpm -aq | grep mozilla
rpm -aq | grep MySQL
rpm -aq | grep php... and so on. Knock yourself out :D

Trogdor
04-05-2004, 03:31 PM
Originally posted by programmer_83
type, http://localhost. but, when i ... type http://localhost/myfirst.html, i receive the Your links are broken. :D

programmer_83
04-05-2004, 04:10 PM
Originally posted by Trogdor
Your links are broken. :D

those links are auto-generated links. :D

snowgod
04-05-2004, 04:57 PM
Originally posted by programmer_83
ok. thank you. but, wat programname should i give to check for the apache server and other programs?

the apache rpm in rh8 is called httpd, so you would do this:
rpm -qa | grep httpd

it looks like you have installed apache from source and I'm guessing that there is probably already a version installed from rpm. Depending on which config file its reading when the service starts will point it to I'm guessing multiple DocumentRoots. If you are putting your web page in one of them and not in the other, then its probably the wrong spot

programmer_83
04-06-2004, 01:25 PM
ok. thanks. but, now, when i try to type the address http://localhost, i receive the 403 forbidden error message, though, i log in as root. i guess, its because of not giving the access permission? how to give access permission to the files.

Uranus
04-06-2004, 02:04 PM
Your files probably don't have the right permissions for world.
As root:
chmod 0754 /path/to/testfile.html
Then try again

Sam

programmer_83
04-07-2004, 02:21 PM
i have checked the access permissions. everything is fine. wat would be the problem? :confused:

knute
04-07-2004, 03:01 PM
Because there is some confusion as to where the actual pages are being loaded from, you could make a change on apaches default page that was loaded into ~ (that's the shorthand for /home/currentuser btw), and then see if the change actually displays when you access the page that apache is serving.

My guess is that it's serving pages up from /var/www rather than ~. But as I said, that's only a guess if you haven't changed the config files to point to a different location.

One change that you could make is to set the title of the page to be where it's located.

My 2 cents,