yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Error writing files : permission denied

Wed Feb 20, 2013 3:14 am

Hello guys. I am trying to set up a web server (although i do not know what to do with it) following this tutorial http://my-music.mine.nu/images/rpi_rasp ... _setup.pdf
However at step A5.1b, i got stuck because when i press ctrl+o, it asks me to type in "file name to write: hosts" i did not change anything but press enter. then it displays "error writing hosts: permission denied"

can someone let me know what is going on?

Also, i need some basic understanding on web server and how i can use it with raspberry pi. Does anyone has a good reference? :)

thank you :)
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: Error writing files : permission denied

Wed Feb 20, 2013 3:39 am

okay, so i have resolved the problem.

type in "sudo nano hostname" instead of "nano hostname" because only root user can modify the file. :)
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Error writing files : permission denied

Wed Feb 20, 2013 3:41 am

These system files should be modified as the root user. So the nano commands should be prepended with sudo as:

Code: Select all

sudo nano /etc/hosts
It looks as if you've missed the step at A3 where you are told to 'sudo su' which means all subsequent commands will be executed as the superuser (root).

A Web server will simply server up 'documents' to client browsers. These documents might be html, when they will be rendered by the browser to give nice looking pages with which the user can interact, or might PDFs or Word docs, they need to be downloaded or display with additional browser plugins or helper applications. The documents may also be generated on the fly, as in CGI and the like, where the server system creates output for display in the browser.

The Raspberry-ness doesn't really matter, it will impose limits on how fast this sort of thing can be delivered and so on, so anything you read will have some relevance. The principal Raspberry feature is the GPIO and the physical computing side of things where, with a few electronic components you could deliver temperature/pressure measurement s (say) via the server. This is more accessible than with a standard desk/laptop system.

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: Error writing files : permission denied

Wed Feb 20, 2013 3:52 am

DBryant wrote:These system files should be modified as the root user. So the nano commands should be prepended with sudo as:

Code: Select all

sudo nano /etc/hosts
It looks as if you've missed the step at A3 where you are told to 'sudo su' which means all subsequent commands will be executed as the superuser (root).

A Web server will simply server up 'documents' to client browsers. These documents might be html, when they will be rendered by the browser to give nice looking pages with which the user can interact, or might PDFs or Word docs, they need to be downloaded or display with additional browser plugins or helper applications. The documents may also be generated on the fly, as in CGI and the like, where the server system creates output for display in the browser.

The Raspberry-ness doesn't really matter, it will impose limits on how fast this sort of thing can be delivered and so on, so anything you read will have some relevance. The principal Raspberry feature is the GPIO and the physical computing side of things where, with a few electronic components you could deliver temperature/pressure measurement s (say) via the server. This is more accessible than with a standard desk/laptop system.
Thanks for replying! Then i am encountering another problem for failing to execute "service apache2 start". not sure what else did i miss. :/

anyway,the idea of transferring sensor data via Raspberry as the server sounds cool! Is there a site or forum thread that provides a basic tutorial on that? :)
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: Error writing files : permission denied

Wed Feb 20, 2013 3:56 am

For easy web server install on a Pi, check out Baked Raspberry Pi Mod.

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Error writing files : permission denied

Wed Feb 20, 2013 4:00 am

sudo service apache restart?

Look the the MagPi issues at http://www.themagpi.com/ where there are some simple examples.

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: Error writing files : permission denied

Wed Feb 20, 2013 5:22 am

all right! thank you :)
i read an article about home automation on issue 8 of MagPi, but i have not come across any project about recording the sensor value and transfer it to another controller system. :(
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Error writing files : permission denied

Wed Feb 20, 2013 5:34 am

You will have to piece together several pieces.

1) Electronic circuit attached to GPIO
2) Software to read the pins - http://code.google.com/p/raspberry-gpio-python/
3) Software (CGI) to post the values into some web-doc

2 and 3 might well be bundled together. Or not. You could write the results of 2 into a database (mySQL) and have web pages making queries on the database.

So many ways to do it. And learn.

yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Re: Error writing files : permission denied

Wed Feb 20, 2013 8:55 am

DBryant wrote:You will have to piece together several pieces.

1) Electronic circuit attached to GPIO
2) Software to read the pins - http://code.google.com/p/raspberry-gpio-python/
3) Software (CGI) to post the values into some web-doc

2 and 3 might well be bundled together. Or not. You could write the results of 2 into a database (mySQL) and have web pages making queries on the database.

So many ways to do it. And learn.
okie! :D Thank you so much! that gave me a clearer idea on what i should explore from now on :)
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

se203
Posts: 4
Joined: Mon May 30, 2016 10:51 am

Re: Error writing files : permission denied

Sat Jun 04, 2016 4:39 pm

I am logged in as root still, I get permission denied when trying to access ./vars or build certificates...

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Error writing files : permission denied

Sun Jun 05, 2016 1:48 pm

A few more details might be helpful here.
What is your current directory? You state its ./vars, who exactly created this directory and what's the full path, ownership and permissions expected to be? What is the output of 'ls -la' for example.
Have you enabled the root account? And are you sure that you are logged into it type 'id' will report the user and its groups. Is this what you expect?

Return to “Beginners”