LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   httpd wont work (https://www.linuxquestions.org/questions/linux-software-2/httpd-wont-work-266029/)

dwig365 12-13-2004 05:21 PM

httpd wont work
 
here is my error from terminal

Quote:

Starting httpd: [Mon Dec 13 17:18:40 2004] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 473 will probably never match because it overlaps an earlier AliasMatch.
[FAILED]

pumazi 12-13-2004 06:12 PM

I'm gonna take a stab by saying, tell us what line 492 looks like because it could be diferent in your file from ours...
and also if you can find the overlap tell us what it looks like... and you may even figure it out yourself once you find those 2 things

dwig365 12-13-2004 06:53 PM

line 473 is:
Quote:

Alias /manual "/var/www/manual"

dwig365 12-13-2004 09:58 PM

anyone? :o

GinEric 12-13-2004 11:24 PM

Apparently, you have either two aliases that are the same, one before line 473 and one in line 473, or, you've inadvertently aliased and alias! That's a no-no.

both are no-no's

Comment out the alias and see if it works.
Then find the other alias causing it to fail.

Don't you hate it when programmers tell you line #473 failed and none of the lines are numbered?

BTW, Apache comes default with the alias for the directory for the manual. A Directory directive that you should easily be able to find.

Looking back, I think you tried to add another alias for the Apache manual when one already existed.

There is also a command to check your httpd.conf file,

apachectl configtest


dwig365 12-14-2004 03:55 PM

nop, it didn't work. does anybody have a default httpd.conf that was included in fc3 and it works? please put it on here. thanks

Inexactitude 12-14-2004 04:17 PM

I'm sorry but I don't think you can upload to this server. Sorry but I don't have any fc3 configs, but I do have a mandrake and freebsd 5.2 if you're at all interested. I can email them to you.

By the way, are you sure that the error you're seeing is causing the failure because it says it's just a warning. Don't know about that though.

For now, I'll take a look at my apache configs and see if I can pick apart your problem.

GinEric 12-15-2004 04:01 PM

If commenting out the aliases didn't work, you're either in the wrong config file or running the wrong Apache.

Did you reinstall?

Did you, by chance, compile Apache?

Did you shell the command apachectl configtest

If the configtest works, but start fails, you have to be in the wrong config, that is, your symlink points maybe to newer or older Apache.
#___________________________
Here's the alias directive for manual:

Alias /manual/ "/var/www/htdocs/manual/"

<Directory "/var/www/htdocs/manual">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
#____________________________

Look at the difference in your alias, no final oblique strokes. But also, if you comment the entire script above, it cannot be in this alias and you've eliminated at least one possibility.

Why don't you post your alias scripts from httpd.conf and we'll have a look at them.

BTW, if you get the Apache tarball for fc3 for the version your running, untar to a temp directory, copy the httpd.conf in the tarball, you'll have the default config. Then, just delete the directory you untarred it to. Don't forget to first copy your current httpd.conf as something like httpd.conf.old

Try again, post your aliases. It's got to be what Apache says, a bad alias.

scotter 01-29-2005 10:26 PM

I ran into exactly the same problem after upgrading from RH9 to Fedora Core 3.
The problem appears to be because of manual.conf which now exists in /etc/httpd/conf.d/
The default httpd.conf includes *.conf files within this directory.

I just renamed mine out the way and apache stopped moaning :)

GinEric 02-10-2005 12:29 AM

Somebody really needs to read Julius Caesar here!

Divide and Conquer; tell the people that they need the Roman Legions and an Emperor for their personal safety, and anyone who thinks that war is not the ugliest thing, they apparently have not seen a two-year old baby girl burned to death by napalm, or a Sharon missile blowing up another two-year old baby girl and getting away with such war crimes citing their "patriotism."

For God's sake, get off the war kick.

scotter 02-10-2005 05:04 AM

WTF GinEric?

GinEric 02-27-2005 10:16 PM

Sorry if you misunderstood, that response was elicited from Inexactitude's signature. I'm just never in the mood for war commentaries about who is and who is not brave. My apologies. I just don't think bombing two year olds, or killing 13 or 14 year olds can be justified by anyone, and epithets aimed at people who don't participate in such war crimes do not belong in a legitimate forum.

I remember 10,000 veterans who marched against Viet Nam after serving numerous terms there. They were far from cowards; the coward is the one who obeys all orders without question out of fear that he will be imprisoned or publicly humiliated by someone who has no conscience and has probably never been in a real battle.

I've had enough war; anyone else?

As for the httpd question, we run two Apache's on the same server. One for the WAN and one for the LAN. Simply renamed them httpd2 and httpd1 and their controls apache2ctl and apache1ctl. They run out of completely different trees and do not know of each others existence.

Partially, it is the "alias" that allows this to work. If the error report says you already have an alias for that directory, then you already have an alias for that directory. That is the problem is it trying to tell you about.

Apache installs with its manual by default. That manual is not under htdocs, but directly under Apache. So, if you try to alias the default, and license required, install, it's going to at least burp!

Path to manual before 2.0:

<IfModule mod_alias.c>

#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# This Alias will project the on-line documentation tree under /manual/
# even if you change the DocumentRoot. Comment it if you don't want to
# provide access to the on-line documentation.
#
Alias /manual/ "/var/www/htdocs/manual/"

<Directory "/var/www/htdocs/manual">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

which says comment the latter part out if you don't want online access to the manual.

If you compile Apache, either 1.3 or 2.0, the layout determines where everything will be. Apache2 usually installs to /usr/local/apache2/ and the config file is now in /usr/local/apache2/conf/ :

#
# This should be changed to the ServerRoot/manual/. The alias provides
# the manual, even if you choose to move your DocumentRoot. You may comment
# this out if you do not care for the documentation.
#
AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/usr/local/apache2/manual$1"

<Directory "/usr/local/apache2/manual">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all

<Files *.html>
SetHandler type-map
</Files>

SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
</Directory>

which you'll notice has a completely different tree structure and Directive [command line set of scripts] to place the manual. So, if you opt instead to install to someplace like /Apache2 instead of the default location, the directory will be:

AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/Apache2/manual$1"

<Directory "/Apache2/manual">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all

<Files *.html>
SetHandler type-map
</Files>

SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
</Directory>

httpd.conf has variations which are called by inet.d usually, somewhere around /etc/rc.d/ or the like. If the initial call is to httpd-std.conf or one of the other supplied config files, then the problem will be in that config file and not in httpd.conf

I personally don't like the use of shell environment variables, like $1 and $2, for referencing the environment's [distribution, architecture, et al] tree because they are too vague. It's a better practice to define the environment with local variables that test the environment. That is for program readability. However, that is another critique for Apache at another time. It's a leftover from the memory scarce 1960's that needs to be eliminated.

Notice that in the above Directives, the manual is placed directly under the ServerRoot for Apache's basic path and not under the www or htdocs secondary directory tree.

This was a good idea in making sure that Apache's links worked regardless of the installation. Other developers could learn from this. Apache will soon be where all documents are placed, for every program, and therefore I have proposed a structure of:

<Apache ServerRoot>/htdocs/docs/<programname>/

rather than the current developer structure of:

<distribtuion dependent path>/<programname>/docs/

because there is no need to duplicate the documents in the program tree, since they will eventually wind up in the httpd server's docs directory for convenience of use by web browsing, rather than by local file browsing.

Also, you cannot move the program docs from the program to the Web Server without failure of the links. Trees like :

<distribtuion dependent path>/docs/glibmm-2.4/docs/reference/html/

use redundant directory structures, and links, such as :

/glibmm-2.4/docs/reference/html/namespaceGlib.html

from gtkmm to glibmm break instantly when ported to the web server.

This is also a basic problem with W3 and html syntax; no rref and iref for relative reference and indirect relative reference.

The second structure,

<distribtuion dependent path>/<programname>/docs/

that of current developers, breaks links as shown by gtkmm and glibmm and is not portable to the Web Server. The developer's links are static, using "../../" to find the ServerRoot which is not where the related documents are or should be to begin with.

The first structure

<Apache ServerRoot>/htdocs/docs/<programname>/

proposed by me, is completely compliant and does not break links and is the most portable place to put documents, at least until W3 fixes their definiton of relative links; their definition itself is wrong. There is no real need for documents under the program's tree anymore because everyone is now expecting, and rightly so, that the documentation will be on a Web Server, and not on a local pc.

SaiBTiger 03-11-2005 08:49 AM

I have the same trouble as dwig365.
After read this page, it is still a trouble--I am a Chinese, and I have learned little English.
Is there a God can tell me the method to solve the problem step by step by step?
Thanks!!!

scotter 03-15-2005 06:54 AM

Quote:

Originally posted by SaiBTiger
I have the same trouble as dwig365.
After read this page, it is still a trouble--I am a Chinese, and I have learned little English.
Is there a God can tell me the method to solve the problem step by step by step?
Thanks!!!

Look for manual.conf which is probably in /etc/httpd/conf.d/ and rename it to manual.conf.old and restart apache.

The problem appears to be because of manual.conf which now exists in /etc/httpd/conf.d/
The default httpd.conf includes *.conf files within this directory, however your httpd.conf Alias the /manual/ and so does manual.conf!
If manual.conf is not in /etc/httpd/conf.d/, do a 'updatedb' (as root) then 'locate manual.conf'


All times are GMT -5. The time now is 10:06 AM.