Tux

...making Linux just a little more fun!

Please help me :(...

Lin, Hong [hlin at devry.edu]


Mon, 29 Oct 2007 18:09:11 -0500

Hi:

I have a wired problem and I hope I can get some help in your place.

I received a "Forbidden / You don't have permission to access /~user/index.html on this server." Error while I try to display my web page.

The OP is Fedora 7 Apache is 2.2.6

Permissions of all directories and files are set to rwxr-xr-x leading from /home all the way to the files inside public_html.

I have modified the httpd.conf file to make sure it looks for the /~user/public_html directory.

I did not touch any other file or area. If I "killall httpd" and run /usr/sbin/httpd, then the index.html under the /~user/public_html displays. That means that it seems worked for my purpose.

However, after I run "/etc/init.d/httpd restart", it displayed stopping httpd [ok] starting httpd [ok], but I will not be able to see my index.html file under the /~user/public_html

The system index.html (the testing page) always worked.

The wired thing is after I taking out all the #lines within the /etc/init.d/httpd file, I can use "/etc/init.d/httpd restart" to make it work.

However, when the machine reboots, it does not work again. I have tried to put "/etc/init.d/httpd restart" at end of the rc.local to force the web serve stop and start at the boot. The server will stop and then start, but it does not display my web page.

I have also tried to put "/etc/init.d/httpd stop" and "/usr/sbin/httpd" at end of rc.local. It does not display my web either.

The S85httpd is linked with .../init.d/httpd

I have tried with "/usr/sbin/apachectl start", it does not work either manually or inside the rc.local

Here is the summary:

Manually /usr/sbin/httpd worked (after I killed all the httpd process)

Manually /etc/init.d/httpd worked (only after I took out all the #lines, and I don't know why it matters)

Apachectl never worked.

The machine boot up does not work.

May you help me?

Thanks in advance.

Hong


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Mon, 29 Oct 2007 19:51:08 -0400

On Mon, Oct 29, 2007 at 06:09:11PM -0500, Lin, Hong wrote:

>    Hi:
> 
>    I have a wired problem and I hope I can get some help in your place.
I'm assuming you mean "weird"; otherwise, I'd be trying to figure out how your Ethernet cable figures into this problem. :)

>    I received a "Forbidden / You don't have permission to access
>    /~user/index.html on this server." Error while I try to display my web
>    page.
> 
>    The OP is Fedora 7
>    Apache is 2.2.6
> 
>    Permissions of all directories and files are set to rwxr-xr-x leading from
>    /home all the way to the files inside public_html.
> 
>    I have modified the httpd.conf file to make sure it looks for the
>    /~user/public_html directory.
> 
>    I did not touch any other file or area.
>    If I "killall httpd" and run /usr/sbin/httpd, then the index.html under
>    the /~user/public_html displays. That means that it seems worked for my
>    purpose.
> 
>    However, after I run "/etc/init.d/httpd restart", it displayed stopping
>    httpd [ok] starting httpd [ok], but I will not be able to see my
>    index.html file under the /~user/public_html

Question number one: is Apache the only web server that you have installed? What is '/usr/sbin/httpd' - is it a binary, a link to a program, or what? I've run into this kind of problem before (PHP would or would not work, mysteriously, until I figured out that I was starting one of two different web servers.) Some tests you could run:

file /usr/sbin/httpd strings -a /usr/sbin/httpd /usr/sbin/httpd -h

Conversely, you could try

whereis apache whereis apache2

>    The system index.html (the testing page) always worked.
> 
>    The wired thing is after I taking out all the #lines within the
>    /etc/init.d/httpd file, I can use "/etc/init.d/httpd restart" to make it
>    work.  
> 
>    However, when the machine reboots, it does not work again.  I have tried
>    to put "/etc/init.d/httpd restart" at end of the rc.local to force the web
>    serve stop and start at the boot.  The server will stop and then start,
>    but it does not display my web page.  
Your startup scripts may be starting one server, whereas you may be starting a different one. Do realize, by the way, that the control script for apache2 is called 'apache2ctl', not 'apachectl'.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back


Ben Okopnik [ben at linuxgazette.net]


Mon, 29 Oct 2007 22:34:18 -0400

Hi, Hong -

When you ask for help on a list, you need to keep the list CC'd on subsequent replies unless you've received a specific request to do otherwise. These discussions are intended to serve the Linux community; taking the conversation off the list defeats that intent. Please make certain that tag at lists.linuxgazette.net is in the loop for the rest of this discussion; thanks.

On Mon, Oct 29, 2007 at 07:13:46PM -0500, Lin, Hong wrote:

> Thanks Ben:
> 
> I believe Apache the only web server that you have installed.

OK... what is that belief based on? In other words, have you queried the RPM database to see what you have installed? I'm not saying that you definitely have something else there - I'm saying that you should definitely establish that you don't.

>  However
> there are 9 httpd running when it is boot.

That's pretty typical for Apache. Is that true in all the cases - i.e., in those where /~user/index.html is available and where it's not?

> strings -a /usr/sbin/httpd
> It gives me a long file with strings that it can find.  The most useful
> is:
> Usage: %s [-D name] [-d directory] [-f file]
> /builddir/build/BUILD/httpd-2.2.6/server/main.c
>        %s [-C "directive"] [-c "directive"]
>        %s [-k start|restart|graceful|graceful-stop|stop]
>        %s [-v] [-V] [-h] [-l] [-L] [-t] [-S]
>   -D name            : define a name for use in <IfDefine name>
> directives
>   -d directory       : specify an alternate initial ServerRoot
>   -f file            : specify an alternate ServerConfigFile
>   -C "directive"     : process directive before reading config files
>   -c "directive"     : process directive after reading config files
>   -e level           : show startup errors of level (see LogLevel)
>   -E file            : log startup errors to file
>   -v                 : show version number
>   -V                 : show compile settings
>   -h                 : list available command line options (this page)
>   -l                 : list compiled in modules
>   -L                 : list available configuration directives
>   -t -D DUMP_VHOSTS  : show parsed settings (currently only vhost
> settings)
>   -S                 : a synonym for -t -D DUMP_VHOSTS
>   -t -D DUMP_MODULES : show all loaded modules 
>   -M                 : a synonym for -t -D DUMP_MODULES
>   -t                 : run syntax check for config files
Yep, that looks like Apache. The version, though, says that it's apache2 - a bit confusing. Anyone here more familiar with Apache2 on Fedora than I am?

> -----Original Message-----
> From: Ben Okopnik [mailto:ben at linuxgazette.net] 
> Sent: Monday, October 29, 2007 4:51 PM
> To: Lin, Hong
> Cc: tag at lists.linuxgazette.net
> Subject: Re: [TAG] Please help me :(...

Ugh. Please don't quote all the previous material; it wastes bandwidth. I suggest that you read "Asking Questions of The Answer Gang" at http://linuxgazette.net/tag/ask-the-gang.html to get some idea of list etiquette, so you can avoid conflict when asking questions on lists.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back


Ben Okopnik [ben at linuxgazette.net]


Mon, 29 Oct 2007 22:46:17 -0400

On Mon, Oct 29, 2007 at 07:22:09PM -0500, Lin, Hong wrote:

> 
> Hi Ben:
> 
> How can I check how many different web services it is running?

How many it's running at any one time should be pretty easy: one, unless you've set something up to run on a non-standard port (and you'd most likely know it if you did.) If you have 'lsof' installed, you could look at all the ports where your system is listening by executing

sudo lsof -n|grep LISTEN
-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back


Lin, Hong [hlin at devry.edu]


Tue, 30 Oct 2007 13:16:28 -0500

Thanks Ben:

I believe Apache the only web server that you have installed. However there are 9 httpd running when it is boot.

'/usr/sbin/httpd' - is a binary

Results of running the following:

file /usr/sbin/httpd
/usr/sbin/httpd: ELF 32-bit LSB shared object, Intel 80386, version 1
(SYSV), for GNU/Linux 2.6.9, stripped
`` strings -a /usr/sbin/httpd ''

It gives me a long file with strings that it can find. The most useful is:

Usage: %s [-D name] [-d directory] [-f file]
/builddir/build/BUILD/httpd-2.2.6/server/main.c
       %s [-C "directive"] [-c "directive"]
       %s [-k start|restart|graceful|graceful-stop|stop]
       %s [-v] [-V] [-h] [-l] [-L] [-t] [-S]
  -D name            : define a name for use in <IfDefine name>
directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed settings (currently only vhost
settings)
  -S                 : a synonym for -t -D DUMP_VHOSTS
  -t -D DUMP_MODULES : show all loaded modules 
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
`` /usr/sbin/httpd -h ''

Same information as above

> Conversely, you could try
> 
> whereis apache
> Nothing is found
> whereis apache2
Nothing is found

This machine has no apache2ctl It runs Fedora 7 Linux and Apache 2.2.6

Any more hint for me?

Thanks,

Hong


Top    Back