Solved

Access denied on /var/www ubuntu server

Posted on 2013-11-07
8
1,368 Views
Last Modified: 2013-11-20
OK,

I'm new to Ubuntu. I needed to setup a LAMP server to do some PHP testing on. Installation went smooth, no problems. So first issue I have, if I use filezilla or Cyberduck to copy files to the /var/www folder I get access denied. I'm using the user id and password I setup during the installation steps, but still no luck. What am I doing wrong. I am able to go in as root on the command line to edit the index.html file. I changed it to index.php with no problem. I used dreamweaver to setup a FTP site and I'm able to see all the directory structure. I am unable to save a file to that folder from dreamweaver. Newbie needs some help. Please keep it simple.....
0
Comment
Question by:rraymond1130
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39631874
That directory belongs to 'root' and Ubuntu is set up to force you to use 'sudo' to act as 'root'.  You will have to 'sudo' to root to do anything with the files there.  The user id and password should get you access to your own folders in '/home'.  You could FTP to a folder there and then use 'sudo' to copy them from there to '/var/www'.
0
 

Author Comment

by:rraymond1130
ID: 39632059
OK,

I was able to copy my php file to my home folder, but I'm unable to open it from there. Now does the PHP files have to be in a certain folder in order to be displayed. This is my first Linux server so I'm a little raw at this.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39632078
Yes, PHP files must be in a folder that is part of the web root or web server directories.  PHP must also be installed on the server.  I don't know if it is automatically included unless you did the LAMP install.  See here: https://help.ubuntu.com/community/ApacheMySQLPHP
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:rraymond1130
ID: 39632089
I did the LAMP install myself. There has to be a way to give my user permission to write to this directory to make my php files work?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39632202
this directory
Which directory?

If it is '/var/www', you can change the permissions.  Note that this would Never be done on a publicly accessible web server because it allow anyone to write to that directory.  Open a terminal window and type these commands.
cd /var
sudo chmod 777 www
cd www
sudo chmod 777 *
exit

Open in new window


This will allow you to write to that directory and all the files that you copy there will be under your user.
0
 

Author Comment

by:rraymond1130
ID: 39632233
This is a private server not web-facing. Thanks that worked...
0
 

Author Closing Comment

by:rraymond1130
ID: 39663915
I thought I closed this question
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39663933
Well you have now.  Thanks for the points.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question