LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to change/edit html files in new Ubuntu 9.04 / Apache server (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-change-edit-html-files-in-new-ubuntu-9-04-apache-server-763343/)

murphy-o 10-20-2009 10:26 PM

Unable to change/edit html files in new Ubuntu 9.04 / Apache server
 
I suspect that this has come up numerous times, but I am new to Linux and I am setting up a new in-house server using Ubuntu 9.04 and Apache, etc.
I can see the welcoming "It Works!" message when I log in via Firefox. I can see "index.html" when I FTP the server with the site name and password at /var/www. I can also see the -rw-r-r-- attributes, but I can't edit the HTML file or replace it.
When I try to rename the "index.html" file, I get the following message:

"Request denied.
Verify that the file or folder exists and that you have the necessary permissions on the server to perform the requested operation."

I haven't been able to determine where to enter the password or what changes I need to make to be able to work with the /var/www directory via FTP.
Any help will be appreciated. If this has been dealt with in plain English elsewhere, a link would be helpful.

Thanks, Murphy / Nicola Valley Museum

eth1 10-20-2009 11:28 PM

Most likely, the file ownership and permissions only allow the root user to modify/edit that file.

In order to modify the file you need to login into the server via SSH (if it's at a remote location) or at the terminal and execute the command,

Quote:

sudo vi /var/www/index.html
This will prompt you for your user login password. It should open the file index.html in a text editor vi with read and write access.

You need to check for the commands sudo and editor vi.

murphy-o 10-21-2009 12:16 AM

Thanks, sudo, vi, etc. works to edit the actual file, but I still don't know how to change permissions so that I can replace or add files in the var/www directory when I log in via FTP. I have been able to do that for years on various hosted websites, but I'm missing some knowledge in setting up my own server so that I can make changes via FTP. Murphy

linuxlover.chaitanya 10-21-2009 12:23 AM

You can use chmod to change the permissions. man chmod to learn the command. To change the ownership of the file, use chown. man chown to lean the command.

murphy-o 10-21-2009 11:18 PM

Thanks to both of you. The "ownership" turned out to be the problem.
I used "sudo chown -R nicola /var/www" to change the /www directory ownership and now my logon password applies to it and I can transfer files via FTP.

Now I can continue my steep learning curve to set up Digital Collection Builder for our small-town museum.

Thanks again
Murphy
Merritt, BC Canada


All times are GMT -5. The time now is 05:17 AM.