• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Moving web site and wiki from local flash to USB  (Read 1479 times)
motters
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: May 25, 2010, 05:29:11 AM »

I'm trying to move data from the local flash onto a USB stick.  The USB stick is formatted with ext3 and I can mount it and copy files to it without any problem.  I've copied the var and tmp directories to the USB drive

Code:
cp -r /var /mnt/sda1
cp -r /tmp /mnt/sda1

and altered /etc/lighttpd/lighttpd.conf and /etc/mysql/my.cnf to point to the new data location.  However if I restart lighttpd I get the following:

Code:
root@debian:~# service lighttpd restart
Syntax OK
 * Stopping web server lighttpd                         [ OK ]
Syntax OK
 * Starting web server lighttpd                         [ OK ]
root@debian:~# 2010-05-25 13:12:59: (log.c.62) opening errorlog '/mnt/sda1/var/log/lighttpd/error.log' failed: Permission denied
2010-05-25 13:12:59: (server.c.899) Opening errorlog failed. Going down.

I've tried using chmod to alter the permissions on files copied over to the USB drive, but nothing seems to work.

Any ideas on what I'm doing wrong?
Logged

ryazor
Newbie
*

Karma: 1
Posts: 14



View Profile
« Reply #1 on: May 25, 2010, 05:48:19 AM »

You might use the 'chown' command. Find out the lighttpd user in your /etc/lighttpd/lighttpd.conf (server.username) and alter the error.log with 'chown lighttpd /mnt/sda/var/log/lighttpd/error.log'. You could avoid such problems by copying recursive and in preserve-mode (cp -rp /var /tmp /mnt/sda1).

Regards,
ryazor
Logged

motters
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #2 on: May 25, 2010, 06:48:08 AM »

I tried erasing the data on the USB drive and recopying using

Code:
cp -rp /var /tmp /mnt/sda1

I can now see that the /mnt/sda1/var/log/lighttpd and /var/log/lighttpd directories have identical permissions.  Unfortunately though on restarting lighttpd the same problem still remains.

Permissions look like this:

Code:
drwxr-x---  2 www-data www-data    4096 2010-05-23 06:25 .
drwxr-xr-x 11 root     root        4096 2010-05-25 13:42 ..
-rw-r--r--  1 www-data www-data 1227505 2010-05-24 18:38 access.log
-rw-r--r--  1 www-data www-data   49853 2010-05-23 00:02 access.log.1.gz
-rw-r--r--  1 www-data www-data     515 2010-05-24 18:39 error.log
-rw-r--r--  1 www-data www-data    3436 2010-05-22 19:08 error.log.1.gz

Also, deleting the log files within /mnt/sda1/var/log/lighttpd still produces the same "permission denied" error, which suggests that the permission problem might be related to the directories rather than the error.log file.
« Last Edit: May 25, 2010, 07:34:12 AM by motters » Logged

motters
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #3 on: May 25, 2010, 07:42:26 AM »

Problem solved!

Code:
chown root:root /mnt/sda1
chmod 755 /mnt/sda1

The problem was with the permissions of the mount point.  This is my own fault for being lulled into complacency by the use of desktop environments, where you rarely need to mount drives manually from the command line.
Logged

Pages: [1]
Print
Jump to: