Multiple Hard Disk

Support section for FREESCO v0.3.x

Multiple Hard Disk

Postby cgm » Wed Nov 03, 2010 7:02 pm

I have been running 3.5 for quite a while and have been very happy. On my system, I have 2 hard disks. I have access to both of them internally, but have not found a way to use the second drive as part of my web server. I have tried to use the ln command to put a link as a directory inside /www but that directory can not be accessed from the web. Is there a way to create some link between the two drives that is accessable from the web.

Thanks
User avatar
cgm
Newbie
 
Posts: 4
Joined: Sun Jul 15, 2007 11:43 am

Re: Multiple Hard Disk

Postby Lightning » Wed Nov 03, 2010 7:27 pm

There shouldn't be any issue using the ln command to a directory inside the www directory attached to another drive. So most likely the issue is in how you are doing the linking or possibly directory ownership/permissions on the second drive. Please give all of the details of the process you are using or trying to use to accomplish this.

If I were going to do it I would first make sure the directory exist for the first time setup and use this command
Code: Select all
mkdir /www/any-name

mount the second drive in the "boot)" section of the rc_user script like
Code: Select all
boot)
   mount -t ext2  /dev/hdb1 /www/any-name
   ;;
shutdown)
   umount /dev/hdb1
   ;;

Then for the first time setup only I would make sure the ownership and permissions were set correctly with
Code: Select all
chown -R 99:99 /www/any-name
chmod 755 /www/any-name

The above is assuming you are using the second drive with a ext2 file system on it. If you are using umsdos or possibly trying to use vfat then that could be another issue and would require some more effort. There is also a setting within the Apache configuration that doesn't allow following links which could also be an issue, but following symlinks is enabled by default. So you would have to of changed that setting yourself.

Completely off topic to some degree, but when 0.4.3 is released it has the capability of software raid. So those two drives could be combined to act as one drive and give better throughput ;)
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Multiple Hard Disk

Postby cgm » Wed Nov 03, 2010 8:22 pm

My primary drive is mounted as usual to /mnt. /www is a link to /mnt/bootdev/router/www which should also be normal. The web server connects both internally and externally to this directory.

The second hard disk is mounted to /mnt2. It has 2 directories in it, www2 and www3. The permissions on /mnt2, and both www2 and www3 are all drwxrwxrwx.

I have a simple web page in /mnt2/www2

I create a link within /www using the command ln -s /mnt2/www2 xxx

I can then cd to the directory /www/xxx and see the files that are stored there including a web page index.htm.

If I then acces the web page via http://192.168.3.1 I see the index.htm page for the main web page. If I try to access http://192.168.3.1/xxx or http://192.168.3.1/xxx/index.htm I receive an error
403 Forbidden
You do not have permission to get '/xxx/index.htm'.
--------------------------------------------------------------------------------

thttpd

The thttpd is a link to a site at acme.com

I have tried your chown command with no success, I am not sure what the format is of the disk. I also need to find again where I am actually mounting the drive it is not in rc_user.
User avatar
cgm
Newbie
 
Posts: 4
Joined: Sun Jul 15, 2007 11:43 am

Re: Multiple Hard Disk

Postby Lightning » Thu Nov 04, 2010 12:00 am

Ok, I suspect I understand the problem. The web server root directory is actually /www which is a link to the real directory of /mnt/bootdev/router/www and the way that you are trying to do this is not exactly in the right order.

If you are not planning on using the real /mnt/bootdev/router/www directory then you should just mount the second drive to that directory. But you MUST do it in the "boot)" section of the rc_user script before the web server is started. So change the above command sequence and try this instead
edit rc_user
Code: Select all
boot)
   mount -t ext2 /dev/hdb1  /mnt/bootdev/router/www
   ;;
shutdown)
   umount /dev/hdb1
   ;;
The above is assuming the second disk is at hdb1, but it could be hdc1 or hdd1 or even a different partition number.

Then remove any other special code you have in place and the other location you are mounting the second disk at. Reboot the system and it should work fine.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA


Return to FREESCO Support for v0.3.x

Who is online

Users browsing this forum: No registered users and 5 guests

cron