LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 02-03-2007, 10:23 AM   #1
rewtedesco
Member
 
Registered: Oct 2005
Location: Massachusetts
Distribution: Suse 10.0 /XP/ FC5 & 6
Posts: 93

Rep: Reputation: 16
httpd: Too many config files?


I'm not sure if this is specifically a Fedora 6 problem, but I keep banging my head at it: apache, mediawiki.

I ran into a bunch of problems when I decided to convert a larger document I'm working on (text book like writing with lots of math) into the wiki media format, so I can make it later public.
I thought it would be easy to set things up, after reading in the O'Reilly book on Fedora linux (mainly fedora 6) by Chris Tyler about setting up apache and mediawiki. It was fairly easy to get apache to work as a start, but then I seem to be unable to do anything with it. In particular for the mediawiki part:
Fedora 6 installs it in /var/www/mediawiki. It is then, if apache is running, available as http://localserver/mediawiki.
However, there is no way to get to configure it, which should be done following the link on the start page for mediawiki.
Even after following meticulously the steps outlined in the book on apache, I can't access anything in the mediawiki diretory via http. Now I have a few suspicions:

First of all, it is noticable that there are more config files in the whole apache bag than one can usually handle. So, to
start, there is a directory /etc/httpd/conf and a directory /etc/httpd/conf.d, and there seem to be two similar but not equal configuration files, namely
/etc/httpd/conf/httpd.conf and
/etc/httpd/conf.d/system-config-httpd.conf
It appears that the latter, system-config-httpd.conf is used and modified by the gui accessible via
system->administration->server-settings->httpd
Using that gui, I made the directory /var/www/mediawiki accessible via http; I can access it using firefox, which I could before I even used the gui, but can not follow the links on the mediawiki startup window, which i also couldn't do before using the gui.
The first question is, should I just forget about the GUI and do the setup by hand in the
/etc/httpd/conf/httpd.conf file? - And is it the right file to modify?

The second question is then, why are there two different files? And what do they have to do with each other? Is some of this stuff simply broken? The file system->administration->server-settings->httpd looks particularly messy, with many large chunks of blank lines.

The third question would be, why is everything sooooo complicated? If I was setting up a real webserver (this is only for my LAN, and in fact for now just one or two PCs), I might have nightmares about not having located and secured the last config file. I suspect the biggest security threat to computers is the inflation of configuration files, containing ever more jargon and heaps of options, plus a big toolbox full of half working setup-wizards. --- OK, I stop whining now.
 
Old 02-03-2007, 10:58 AM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,191

Rep: Reputation: 49
I didnt read your post completely but here is what I think you want.
/etc/httpd/conf/httpd.conf
thats the conf file, no other files matter.
mediawiki is probably not running cause it should be in
/var/www/html/mediawiki
 
Old 02-03-2007, 12:59 PM   #3
rewtedesco
Member
 
Registered: Oct 2005
Location: Massachusetts
Distribution: Suse 10.0 /XP/ FC5 & 6
Posts: 93

Original Poster
Rep: Reputation: 16
That's a good point. I checked it though: the problem doesn't seem to be that mediawiki has it's own branch off /var/www. The configuration files for the mediawiki seem all to assume that. Things are organized by inclusion of other conf files in conf files. In particular, /etc/httpd/conf/httpd.conf includes the configuration files in /etc/httpd/conf.d. In httpd.conf is a statement
Code:
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf
And there are a lot of things in conf.d, e.g.:
auth_mysql.conf perl.conf proxy_ajp.conf welcome.conf
manual.conf php.conf python.conf
mediawiki.conf phpldapadmin.conf ssl.conf
mod_security.conf phpMyAdmin.conf system-config-httpd.conf

(You see where I'm coming from saying there are too many darn config files? )
In particular, the file mediawiki.conf starts as follows:
Code:
Alias /mediawiki /var/www/mediawiki
hence I assume that the location of the directory mediawiki is correctly in /var/www/mediawiki. The file mediawiki.conf contains lines similar to those in httpd.conf.

Last edited by rewtedesco; 02-03-2007 at 01:02 PM.
 
Old 02-04-2007, 12:22 AM   #4
rewtedesco
Member
 
Registered: Oct 2005
Location: Massachusetts
Distribution: Suse 10.0 /XP/ FC5 & 6
Posts: 93

Original Poster
Rep: Reputation: 16
Solved (mostly)

w3bd3vil's hint was important - It's always good to know which tree to bark up first...
In the file /etc/httpd/conf/httpd.conf I added the following entry (hostnames are examples):
Code:
#  hack for mediawiki 
<Directory "/var/www/mediawiki">
    AllowOverride None
    Options Includes FollowSymLinks Indexes 
    Order allow,deny
    Allow from localhost.localdomain
    Allow from pc1.homedomain  
    Allow from pc3.homedomain
</Directory>
This would not have been necessary if the directory mediawiki was a subfolder of /var/www/html. Without these directives, apache would not allow access to a folder that is refered to in the mediawiki.conf file. In that file, /etc/httpd/conf.d/mediawiki.conf,, I still have the following code:
Code:
Alias /mediawiki /var/www/mediawiki
<Location /mediawiki/config>
    Order allow,deny
    Allow from all
</Location>
If I'm not mistaken, there should still be no way for a user outside the LAN to access the wiki that I only want to put together locally for now. I think it should be protected as it is, as I have no other machines than localhost, pc1 and pc3 in the Allow statements in httpd.conf. So the wiki should be protected by Apache. At any rate, with this setup, I can now start to work on the wiki itself. (if someone suddenly corrects my math in the wiki, that would be how I find out that my setup is still not working right).
BTW, I completely got rid of the file /etc/httpd/conf.d/system-config-httpd.conf which is one of the additional configuration files that are included into httpd.conf by the include statement
Code:
Include conf.d/*.conf
I think it's superflous for the particular setup I have, as it only replicates many of the settings that are already in httpd.conf. This however may only apply to my special case.
 
Old 02-06-2007, 11:04 PM   #5
rewtedesco
Member
 
Registered: Oct 2005
Location: Massachusetts
Distribution: Suse 10.0 /XP/ FC5 & 6
Posts: 93

Original Poster
Rep: Reputation: 16
look at /etc/hosts to avoid barking up wrong trees

One important thing that kept me for a long time in the loop is the new IPv6 standard of writing the loopback address of a host.
I could not understand that, even after giving full access to all hosts on the LAN in the httpd.conf file, I still got messages in /var/log/httpd/error_log that told about the host named [::1], which wasn't allowed. When I then realized that everything worked fine if I browsed the wiki on this PC from a different PC on the LAN, but nothing when I worked on this PC, I somehow got the message. Then I found Mauriat Miranda's "personal installation instructions" at http://www.mjmwired.net/resources/mjm-fedora-fc6.html. With the IPv6 standard, the file /etc/hosts in FC6 initially contains the following statement:
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1    localhost.localdomain   localhost
One has to be a little disrespectful in regards to this warning, since with the following, I finally got apache to behave as expected (modified /etc/hosts):
Code:
# hack the following lines as good as you can
# after noticing that you have never seen something like 
# ::1 before and don't really know why it would make sense.
# However, don't cry if nothing works afterwards
127.0.0.1  ::1 localhost.localdomain localhost kitchen kitchen.steam.pc
was all that Apache needed to generously allow access to itself. Duh!

Last edited by rewtedesco; 02-07-2007 at 10:36 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
httpd config error !!! Help me tritong Linux From Scratch 9 12-26-2005 07:42 PM
Easy httpd config: Config for ~user lsgko Linux - Software 0 08-21-2003 11:55 PM
Easy httpd config: Config for ~user lsgko Linux - Newbie 2 08-18-2003 05:34 PM
httpd server config .. on RH 8 huno Linux - General 6 03-15-2003 12:14 PM
httpd.config file??? httpd_config Linux - Software 4 02-16-2001 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 09:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration