LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-03-2005, 08:40 AM   #1
funehmon
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Rep: Reputation: 0
SIMPLE Apache question


I am a complete noob, but have gotten interested in Linux. I successfully installed Fedora Core 3 the other day on an old machine. The hard drive that I installed the OS on is pretty full of all of the packages I selected to be installed.

I'm tinkering around with Apache and have gotten my site to work in the default /www/html directory. However, I was running out of space quite quickly.

I acquired another HDD from a friend and mounted it as /mnt/hdc1. I moved my home directory to it and am able to read/write/execute programs on it. I then moved the entire contents of my WWW folder to this new hdd and tried to configure Apache to look to this drive instead of the default document root location.

I have changed httpd config file from "DocumentRoot "/var/www/html"

to:

<vituralhost *>
DocumentRoot " /mnt/hdc1/www/html"
</virtualhost>

(forgive the syntax if it is not perfect, i am at work and reciting from memory)


When i restart Apache, it said [Failed] and said "Document Root /mnt/hdc1/www/html does not exist".

I have tried changing /mnt to /dev, and just making it /hdc1...but nothing seems "to exist". When I type in the IP of my Linux web server in another PC's Internet address bar, I get "Forbidden 403" error. If I revert to the old configuration, it works fine.

I have also tried just chaning the DocumentRoot to point to "/mnt/hdc1/www/html" but i get an error stating that DocumetRoot must be a directory.

Can someone tell me how to point Apache to the second hard drive instead of the primary?

THANK YOU !!!

Sean

Last edited by funehmon; 02-03-2005 at 09:56 AM.
 
Old 02-03-2005, 09:57 AM   #2
funehmon
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
bump
 
Old 02-03-2005, 10:07 AM   #3
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
edit: sorry, didn't notice that you also tried DocumentRoot -- which, btw, is the option you should use to configure it. virtualhosts is for configuring multiple domains to the same server. it doesn't sound like you want that.

is /mnt/hdc1/www/html a directory? make sure the drive is in fact mounted, of course, and don't forget to restart apache (# apachectl restart) after you make config changes.


p.s. i would just make a /mnt/www directory to mount the partition, instead of complicating things with a redundant subdirectory. makes things a little easier. if you want an /html directory under that, you can just make it on the partition after it's mounted.

so iow, you would make /mnt/www, mount /dev/hdc1 to /mnt/www (also changing fstab so it mounts at boot), and change the apache config to: DocumentRoot /mnt/www. (no period. ) make sure the virtualhosts part is commented out again, also, then reboot or re/start apache.

see if that works, hope it helps.

Last edited by synaptical; 02-03-2005 at 10:27 AM.
 
Old 02-03-2005, 10:37 AM   #4
funehmon
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
I am familliar with editing the fstab file. However, can I make this an ADDITIONAL mount point, or do i have to # out the first mount point (/mnt/hdc1) to do this? Reason it matters, i have other things pointing to this device such as my home directory. So I'd like to keep the hdc1 as a mount point if i can.
 
Old 02-03-2005, 11:41 AM   #5
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
Quote:
Originally posted by funehmon
I am familliar with editing the fstab file. However, can I make this an ADDITIONAL mount point, or do i have to # out the first mount point (/mnt/hdc1) to do this? Reason it matters, i have other things pointing to this device such as my home directory. So I'd like to keep the hdc1 as a mount point if i can.
you have both /home and /www on hdc1? if so, i guess you would mount /dev/hdc1 at /home, and then point apache to /home/www. (edit: or are you saying they are independent, one not a subdirectory of the other?)

but imo it would be much better to create another partion on hdc and make that your /www. then in fstab you would mount /dev/hdc1 at /home and /dev/hdc2 at /mnt/www, and point apache to /mnt/www.

let me know if i've misunderstood something, i'm a little confused by the description of your setup.

Last edited by synaptical; 02-03-2005 at 11:47 AM.
 
Old 02-09-2005, 02:30 PM   #6
funehmon
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Ok, I tried doing this and screwed up the Fstab file...so i formatted and started over.

This time I installed Linux on the 20 gig drive, and partitioned the 5 gig for FTP, WWW and just open space.

I mounted the second drive as /www and /FTP. I look in Fstab, and it has
Lable=www /www ext3 defaults 1 2. (same for FTP)

in my filesystem i have 2 new folders (/www and /FTP) which I guess it's using as mount points. when i put files in /mnt/www they also appear in /www (under my /dev/hda1/)

I have my html files in a folder under /www called "files". I have tried every combination of DocumentRoots like /mnt/www/files or just /www/files ...they all say DocumentRoot must be a directory when I restart Apache.


HEEELP.

Last edited by funehmon; 02-09-2005 at 02:39 PM.
 
Old 02-09-2005, 11:01 PM   #7
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
Quote:
Originally posted by funehmon
This time I installed Linux on the 20 gig drive, and partitioned the 5 gig for FTP, WWW and just open space.

I mounted the second drive as /www and /FTP. I look in Fstab, and it has
Lable=www /www ext3 defaults 1 2. (same for FTP)
i have no idea what that means, "Lable." reference man fstab if you're having trouble with fstab.

you can only mount one partition per mount point, so (for example) if the partition with www on it is on the first partition of the second hard drive (we'll call it hdb1), and you want to mount it at /mnt/www, the fstab entry would look something like this:

/dev/hdb1 /mnt/www ext3 defaults 1 2 (or 0 0, man fstab to read the options.)

if FTP is on partition 2, you would make a /mnt/ftp directory, and add this to fstab:

/dev/hdb2 /mnt/ftp ext3 defaults 1 2

if you have www and ftp on the same partition on hdb, you would just mount the partition at the mount point (we'll call it /mnt/web), and direct apache and ftp to whatever directories you want that will appear under there, e.g.:

/dev/hdb1 /mnt/web ext3 defaults 1 2


Quote:
in my filesystem i have 2 new folders (/www and /FTP) which I guess it's using as mount points. when i put files in /mnt/www they also appear in /www (under my /dev/hda1/)

I have my html files in a folder under /www called "files". I have tried every combination of DocumentRoots like /mnt/www/files or just /www/files ...they all say DocumentRoot must be a directory when I restart Apache.
so if i'm reading you right and the "files" directory is a subdirectory of www on the first partition of hard disk 2 (hdb1), mount hdb1 at /mnt/web (or replace "web" with whatever name you want), and then point apache to /mnt/web/www/files.

on my setup, i mount the second hard drive with www data at /mnt/www. i want ftp users to be able to ftp into their www directory, so i just point my ftp config to the www directory i made to contain the users (/www/user/).

hth


------------------
p.s. don't forget to change the Directory option a few lines down from DocumentRoot to whatever you set DocumentRoot to:


#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory /mnt/www/>

Last edited by synaptical; 02-09-2005 at 11:06 PM.
 
  


Reply



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
Simple apache question technochef Linux - Software 5 09-06-2004 06:31 PM
Redhat 9 and Apache simple question. hurgh Linux - Software 5 10-07-2003 01:31 AM
simple Apache Mandrake question lang40 Linux - General 2 10-07-2003 12:25 AM
Simple Apache Question ppuddick Linux - Software 3 07-09-2003 11:15 AM
Apache question...hopefully, simple tarballed Linux - Networking 1 02-04-2003 11:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:24 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