• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ubuntu and apache ...index.html

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i installed php5 and apache2 with the following:

sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install apache2-mod-php5


but when i go into my var/www directory when i try to edit my
index.html file, its says its readonly, and can't be modified.


how can i fix this?

Thanks,
Justin Fox
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must first alter the privileges over the file.

First, you must know what is the password of the root account. If you do not know the password of the root account you can change it with

$ passwd root

And after resetting a new password, you can invoke the chmod command to grant yourself privileges over the file.

$ chmod a+rw index.html

Hope that helps!
[ October 25, 2007: Message edited by: Edwin Dalorzo ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unix - including Linux and Solaris - is a fairly secure OS. In the stock Linux distros, Apache runs as a special user - usually it's something like "apache".

So if you do an 'ls -l /var/www/index.html', you'll see who owns it and what rights are available.

For maximum security, it's best to either do editing either under the account of the apache user or as a member of the apache group (assuming that the pages are group-writable). If you open it up to everyone (chmod 777), then there's a chance that someday someone may come in and do Bad Things.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replies, the logging in under root will probably help.
I didnt know the password, or know how to get/change it, but now I do.

Thanks,

Justin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic