LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem accessing files copied from CD to HD (https://www.linuxquestions.org/questions/linux-newbie-8/problem-accessing-files-copied-from-cd-to-hd-274405/)

wildebs_27 01-05-2005 08:42 PM

Problem accessing files copied from CD to HD
 
Hi, I'm very new to Linux and I'm having difficulties accessing some files from apache. Let me clarify.

A friend brought me his CD so I could check his modification to his web page. So I removed my files from my test site and copied his from his CD to the default html home directory. To my estonishment, the front page ( index.html ) was accessible but very screwed. So I want to the html directory to discover that all the files were "bright green" and had a STAR ( * ) at the end ex.: index.html * what a hell is that ??? I want to the CD directory in /mnt/cdrom and found all files in the similar situation. I want to see my files that I removed my test site and they were all fine, I mean in their original regular colors.

How can I solve this problem ??? What does the green color mean and what does the * means ??? How can I make those files become " normal " ???

This is the command I used to copy the files from the CD to my HD :

cdrom_> cp -R * /www/html

What did I do wrong ??? I used the -R for recursive because he has directories as well that I needed to copy.

HELP !!!! URGENT !!!!

leonscape 01-05-2005 10:04 PM

Green usually means that there executable. ( IT thinks there scripts ).

Also what is the output when you do "ls -l" ( Without quotes )

Shade 01-06-2005 01:58 AM

The green color and * mean that those files are marked as executable. It's a fault in the translation between fat32/ntfs and whatever unix filesystem you're using -- windows file systems don't use those properties, so when you copy them, they all get set with it enabled by default.

To fix:

chmod -R 755 * from within the server's root... aka
/var/www/htdocs

--Shade

wildebs_27 01-06-2005 07:48 AM

Thanks Shade

After doing your command, they were still green with * but at least the page was working perfectly !

:D

Shade 01-06-2005 09:21 PM

That's because they were still marked executable to the owner (probably root, and probably what you were running as...) but to the apache user, or nobody user which the server was running under, they were not.

(7 - owner 5 - group 5- all others)

--Shade

wildebs_27 01-07-2005 07:13 AM

I was running as root when I was copying the files.

Just for curiosities sake, would there have been another way of cp the files so they couldn't be green with *, I guess not since on the CD they were like that. Because it falses the statistics, I mean by that, that html files aren't programs, nor php files nor png files.... is it possible to change the file type ??? :scratch:

Boow 01-07-2005 05:18 PM

try chmod -R -x. chmod 755 is rwx owner rx group rx everyone. the -x option removes the exucutable bit

Electro 01-07-2005 06:23 PM

Linux has no relationship of filetypes. Linux is using the DIRCOLORS file to translate the file extension to a desire color. A lot programs in Linux guesses the format of the file and tries to open it. Usually they work quite well, but sometimes it may need a hint by looking after the period of the file name. Also Linux works with permissions that the filesystems for CD, DVD, FAT, FAT32, NTFS/HPFS does not support. Linux will usually default it to either 755 or 777 when it mounts those filesystems. The permissions that you can set for either a file or directory can be either a read, a write, and an execute characteristic. Linux does not stop there. Like someone saids Linux a three sets that it can give permission to. The first digit is user. The second digit is group. Third digit is other (everybody).

You should not be as root when copying files from a CD or DVD because you do not need to.

You can do "find directory_name -type d -exec chmod -v 755 {} \;" for the directories and "find directory_name -type f -exec chmod -v 666 {} \;" for the files. You can not do the above on a CD because it is read-only. Do the above after you have copy it to the hard drive.


All times are GMT -5. The time now is 12:20 PM.