PDA

View Full Version : Index.html in /ramdisk/var/www and chainging permissions



JHM_MKE
08-29-2004, 03:54 PM
After starting up knoppix from a CD, I start up Apache.

Then I want to delete the index.html used by Apache (in /ramdisk/var/www) but I can't seem to change the permissions on it so that I can delete it?

I can copy files to the directory (/ramdisk/var/www) but for some reason, I can't chmod the index.html and delete it?

I am sure I am just being stupid but what am I doing wrong?

I tried,

chmod 777 /ramdisk/var/www/*

and it returned,

chmod: changing permissions of '/ramdisk/var/www/index.html' : Read-only file system
chmod: changing permissions of '/ramdisk/var/www/search.html': Read-only file system


I also tried (with no luck),
sudo chmod 777 /ramdisk/var/www/*


:?:

JHM_MKE
08-29-2004, 08:58 PM
I resolved my own problem but I am still not quite sure I understand why?

I tried to edit the original Apache "index.html" web page and I couldn't save it to "/ramdisk/var/www/index.html" from the Mozilla Composer application?

I could save it to "file:/home/knoppix/index.html".

Then I started up a "root shell" and did a "rm /ramdisk/var/www/index.html"

Once it was removed, then I could copy the new index.html over from my home directory with "cp index.html /ramdisk/var/www/index.html"

I think the original index.html was a link to the CD and that is why I couldn't save it because I can't write to the CD where the file really existed? Once I deleted the link then I could save index.html to "/ramdisk/var/www" folder.

shah
08-30-2004, 05:29 AM
JHM_MKE

What you can do is, create your webpages in either home directory or create a folder on hardisk then point apache to that directory.
To achieve this, you need to edit your /etc/apache/httpd.conf:
Find lines that says:
# 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/******this is the lines need to be edited. Change to the directory of your webpages located.
Ex:
DocumentRoot /home/www
or
DocumentRoot /mnt/hda1/www ***remember to mount first.

Save it and restart apache : /etc/init.d/apache restart.
To try it, open your browser and point it to your IP

. :D :D

Cuddles
08-30-2004, 03:48 PM
JHM_MKE,

Not sure on this, I don't have Apache on my install, don't use it, but...

I think you are right, about the symlink thing... I had a heck of a time trying to "lock down" my incoming modem / dial-up connection. I was able to change the permissions on my /ttyS0, but, when I tried to change my /dev/modem permissions, it seemed it worked, didn't error, but never did anything - e.g. my permissions never changed to what I told them too. I realized that you CAN'T change permissions on symlinks, and thus, my /dev/modem was a symlink to my /dev/ttyS0

I am not sure on this one either, guessing here, but the reason why you got an error from your Konsole CLI chmod and from your "sudo" done chmod, may be that you had to be root, not simulated, or sudo'ed - but physically "be" root - and thus, like my /dev/modem issue above, wouldn't have yelled an error at you, but, not actually done the change for you, if you looked afterwords. ( guessing here too )

Clueless, just more input,
Ms. Cuddles