Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am new to ubuntu.I install LAMP pakage acording to this page. I want to create new website such as say in this article. but when I create my site in "sites-avalible" and whant to chanege it and save,show a message ...

Error opening file '/etc/apache2/sites-available/mysite': Permission denied

The file on disk may now be truncated!

what I should to do?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You need to run your editor with sudo, because site configuration files cannot be modified by users.

For example:

$ ls -l /etc/apache2/sites-available/default
-rw-r--r-- 1 root root  950 2011-06-07 14:56 default

You should try to follow the official Ubuntu Server Guide. It is a very concise and clearly written article on what you'd like to achive.

share|improve this answer

To fix it, use sudo to edit the file: sudo gedit /etc/apache2/sites-available/default
Then enter your password, and that's it.

gedit is one possible editor, but you can use any of them you like: vim, nano, pico, etc..

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.