Unable to copy files to var/www

Asked by DocHobbes

I can't copy files into the www folder in my root folder. It's saying access denied. I'm trying to copy in a index.html file and a script.js file.

  I'm going about this by going from the desktop up to home then up and into var/www and trying to drag and drop from the folder where I have them stored.
   I've tried logging in as root but it says I can't login as root from the login window...I'm starting to get desperate...windows sucked...but this issues holding me up from what I'm trying to do...

 I feel like an old windows dog trying to learn new tricks.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu dolphin Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
DocHobbes (michaelmarsalisi) said :
#1

...not sure how this got posted under dolphin...I'm confused.

Revision history for this message
DocHobbes (michaelmarsalisi) said :
#2

...not sure how this got posted under dolphin...I'm confused.

Revision history for this message
corenominal (corenominal) said :
#3

Hi DocHobbes,

There are several ways you could copy your files:

 1. Use the sudo command and enter your password when prompted. e.g.

    sudo cp ~/index.html /var/www/index.html

 2. Or, open your file manager with root permissions and then copy your files, e.g.

    gksudo nautilus

^^ replace nautilus with whatever file manager you are using.

Also, I'm not sure if this will help, but I have set-up a symbolic under "/var/www" to a directory under my home directory. The command to do this goes a little like this:

    sudo ln -s /home/username/htdocs /var/www/htdocs

* note that the "~/htdocs" should exist before entering the command. Once set-up, any files placed in "~/htdocs" will be available through the webserver under http://localhost/htdocs/ - this solves the permissions problem too.

There are other methods you could use, such as editing the Apache conf files to point the default site to a directory under your home directory etc.

Hope this helps :)

Revision history for this message
banger (banger) said :
#4

"...not sure how this got posted under dolphin...I'm confused."

???????????

I think he must be using dolphin pedo...file manager and trying to sudo;-)!!!!!!!!!!!!!!

Can you help with this problem?

Provide an answer of your own, or ask DocHobbes for more information if necessary.

To post a message you must log in.