I'm trying to activate mod_rewrite module on a Ubuntu 11.04 server (natty) and I having problem to edit the file 000-default in 3rd step, the steps to activate the module are:
1-Install Apache web server in Ubuntu Linux
2-Enable mod_rewrite module in Apache web server with:
$ sudo a2enmod rewrite
3-Edit the site file 000-default located in: /etc/apache2/sites-enabled/ directory, changing all AllowOverride None to AllowOverride All:
/etc/apache2/sites-enabled/000-default
4-And finally, restart Apache with:
sudo /etc/init.d/apache2 restart
The file looks blue when I see it in terminal with "ls" and a print is as below:
It is a symbolic link so the permissions are determined by those of ../sites-available/default . You can either change these permissions or use :w! to write the file..
When you do vim 000-default , you are really editing ../sites-available/default through the symbolic link. If you change the permissions like this: chmod u+w 000-default - which means you are giving write access to the owner of ../sites-available/default - then you will no longer get that message..
Alternatively if you exit vim after your changes, using :w! you should be able to override the readonly permissions..
It is u+w , not u+v (see man chmod) . The permissions weren't 777, because those belong to the symbolic link, not the actual file (../sites-available/default).. You can check the permissions of that file with
ls -l ../sites-available/default
alternatively if you use
ls -lL 000-default
ls will follow the symbolic link and display the permissions of the actual file. I would expect the permissions to be 444 ( -r--r--r-- )