Fedora Linux Support Community & Resources Center
  #1  
Old 28th March 2009, 10:23 AM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,930
Apache / Wiki question

One of my computers is a server for my wiki, a backup destination and a source for my local repositories. The computer is on 24/7/365. Setting up the wiki was easy. Setting up the repository was slightly more difficult. After studying the apache error logs I determined that I needed to add a line in /etc/httpd/conf/httpd.conf in the DocumentRoot section pointing to the path of the repository. Once done the repo worked perfectly and has done so for many months now. Recently I've had trouble with the wiki. I don't know the proper terminology here. All I know is that www.johnson.homelinux.net no longer works. (It does now) I was geting the Apache / Fedora test page. But if I used www.johnson.homelinux.net/mywiki I get the wiki. Thinking about what changes were made "recently" and again studying the error logs I figured that maybe the problem was with httpd.conf, so I went in and commented out the line that I had previously added. Here's a cut from that file. The added / commented line is highlighted in red.
Code:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/moin"
#DocumentRoot "/repof10"


So, with the new line added the wiki and repo both worked well. One day the wiki stopped working unless I added /mywiki to the end of the url. Once I commented the second line out the wiki started working properly again. Of course now my local repository doesn't work. Am I breaking some sort of rule by adding the second "DocumentRoot" to the config file?
__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #2  
Old 28th March 2009, 01:51 PM
Sauron Offline
Registered User
 
Join Date: Jan 2005
Posts: 257
As far as I'm aware, there can only be one documentroot. Everything else needs to be an alias or a branch underneath documentroot. Virtual servers each have their own documentroot but you're not attempting to have multiple www.x.com things going here, right?

It seems that Apache is using the last documentroot in the file as it's home directory. Not unreasonable, since it's likely not looking for more than one.

Did you run httpd -t to check the config file for syntax and see if it was complaining about the multiple documentroot lines?
Reply With Quote
  #3  
Old 28th March 2009, 02:09 PM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,930
Hello Sauron. Thanks for the reply.
Quote:
Originally Posted by Sauron View Post
As far as I'm aware, there can only be one documentroot. Everything else needs to be an alias or a branch underneath documentroot.
Does that imply that I should have /repof10 as a sub-folder of /var/www/moin ?
Quote:
Originally Posted by Sauron View Post
Virtual servers each have their own documentroot but you're not attempting to have multiple www.x.com things going here, right?
Only one www. My repository is specified in repof10.repo as baseurl=http://192.168.1.105/. That points to the networked box slowhand which hosts the wiki and contains the repo folder(s).
Quote:
Originally Posted by Sauron View Post
It seems that Apache is using the last documentroot in the file as it's home directory. Not unreasonable, since it's likely not looking for more than one.
That would seem to explain why the wiki stopped working but not why it at one time was working with this configuration.
Quote:
Originally Posted by Sauron View Post
Did you run httpd -t to check the config file for syntax and see if it was complaining about the multiple documentroot lines?
No. Didn't know I could. If I do it now I get this result:
Code:
[eric@slowhand ~]$ sudo httpd -t
Syntax OK
[eric@slowhand ~]$
Thank you for your interest.
__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #4  
Old 1st April 2009, 09:32 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
You should probably have your repo under a subdirectory of your root directory. Thinking you expect your Wiki be the main page.

Example:
Code:
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#DocumentRoot "/var/www/html"
DocumentRoot "/home/marc/Public"
Code:
#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "/var/www/html">
<Directory "/home/marc/Public">
Code:
Alias /asp "/home/marc/Public/asp/"

<Directory "/home/marc/Public/asp">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Alias /pdf "/var/www/html/pdf/"

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

Alias /cronscripts "/var/www/html/cronscripts/"

<Directory "/var/www/html/cronscripts">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Currently been using Named based Virtual sites, I have three freebie site names thru dyndns.org. Found out last month you can have up to 5 freebie website names with them.
Code:
<VirtualHost *:80>
    DocumentRoot /home/marc/Public
    ServerName kiriyamablevins.dyndns.org
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot /usr/share/wordpress
    ServerName kiriyamablevins.blogsite.org
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot /home/marc/Public/marc
    ServerName marcrblevins.dyndns.org
</VirtualHost>
Maybe you should have a newbie website name for your repo stuff.

Last edited by marcrblevins; 1st April 2009 at 09:37 AM.
Reply With Quote
  #5  
Old 1st April 2009, 01:07 PM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,930
Hi Marc. Thanks for the reply and the interest. Having a local repository is not essential but it's something that I thought would be interesting to have and fun to try. It's been fairly successful to this point, both with Fedora 9 and Fedora 10. Right now, the Fedora 10 repo is disabled and I'm using the "stock" fedora.repo. All is well, but it would be great if I could get the local repo working again along side my wiki.

The repo files are / were located on another drive on this computer. Here's some info that may be useful.

The drive that contains the repo files is as follows:
Code:
Disk /dev/sdb: 30.0 GB, 30020272128 bytes
255 heads, 63 sectors/track, 3649 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00087bab

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3649    29310561   83  Linux
It is mounted thusly:
Code:
/dev/sdb1 on /media/disk2 type ext3 (rw)
The files are in a sub-folder of root on that disk, called /repof10.
Code:
[eric@slowhand ~]$ ls /media/disk2/ -la
total 764
drwxr-xr-x 4 root root   4096 2009-01-08 06:39 .
drwxr-xr-x 5 root root   4096 2009-02-24 16:14 ..
drwx------ 2 root root  16384 2009-01-08 06:33 lost+found
drwxrwxrwx 3 root root 753664 2009-01-08 08:34 repof10
The /media/disk-2/repof10 folder is even Samba shared.
http://img14.imageshack.us/img14/640...ilebrowser.png
and browseable.

The repo file, etc/yum.repos.d/repof10.repo contains
Code:
[repof10]
name=RepoF10 $releasever - $basearch - repof10
#baseurl=http://192.168.1.102/repof10/
baseurl=http://192.168.1.105/
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
192.168.1.105 is in fact "slowhand", the computer that hosts the wiki and the repos. Based on this info, assuming its enough, should I go with the alias? I don't think another web site name will help but I'm not that versed in this sort of stuff.
__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #6  
Old 1st April 2009, 11:38 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
Maybe this may help, out of ideas. Good luck.
I would do the same thing whenever I need another Fedora box running. Would be nice to get this solved.

Bring back this line in your repo file with the correct IP:
Code:
#baseurl=http://192.168.1.102/repof10/
Activate it:
Code:
enabled=1
Add in your /etc/httpd/conf/httpd.conf
Code:
Alias /repof10 "/media/disk2/repof10/"

<Directory "/media/disk2/repof10">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Then at the terminal:
Code:
su -
chcon -R -t httpd_sys_content_t /media/disk2/repof10
service httpd restart
Fire up Firefox to:
http://www.johnson.homelinux.net/repof10

Does it work now?

Cheers
Reply With Quote
  #7  
Old 2nd April 2009, 09:57 AM
glennzo's Avatar
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,930
Hey Marc. Thanks again for your interest. I've followed what you've posted here and made the changes. The chcon command returned errors for all files in the folder. For example,
Code:
chcon: can't apply partial context to unlabeled file `xorg-x11-drivers-7.3-9.fc10.i386.rpm'
Yes, www.johnson.homelinux.net/repof10 works with Firefox. It gives me a directory style listing of all the files in the repository folder. Additionally, the repository works again as it should. This is fantastic Marc. Thank you for taking the time to help me out. This is something that I believe would have taken me a long time to figure out on my own. Now if I were smart I would study just exactly what it is we've done here so that I can handle it myself next time.
__________________
Glenn
The Bassinator © ®


Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
Reply

Tags
apache, question, wiki

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wiki-question maffioso Hardware & Laptops 2 22nd September 2006 09:54 AM
Apache Question carlwill Servers & Networking 2 25th April 2005 11:18 PM
FC3 (yum/apt + apache) question Trel Using Fedora 6 9th December 2004 02:03 AM


Current GMT-time: 15:16 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat