Solved

Access denied on /var/www ubuntu server

Posted on 2013-11-07
8
1,335 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Apache LDAP Authentication 20 72
Redhat upgrade 1 68
Looking for a program called HoneyMine. 3 117
Nee dhelp identifying the OS and how to access 7 93
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

738 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