0

I work in Ubuntu 14.04. Well, I always had the misconception that installing a software from the root user makes the software available to all users. So, I wanted to install apache and add my html pages over there. I installed apache using root user. It installed successfully.

Then to test apache, I typed localhost, and the default page came up successfully. So then I thought about changing the index.html page and adding my code. I was making all my .html files in gedit, and thus tried to change index.html in gedit. When I tried to open it, it told me I could open it in only read-only mode, and I could not change it. Then I figured out that I could not change the permissions, nor change the file in the normal user.

I thought about it for a while, and thought removing the index.html file and adding my on file would work. But it didn't.

Then I uninstalled apache and re-installed it from normal user. Still I couldn't change the index.html in normal user.

So is there a way, to access and change the index.html file of apache installed in root in normal user?

NOTE: I know the password of root, and can even uninstall apache and install it again. This is on my personal computer.

2
  • 1
    I highly recommend checking the following question: How to avoid using sudo when working in /var/www?
    – Dan
    Feb 18, 2016 at 14:51
  • If that question doesn't answer your problem, can you add what doesn't work? Also, when you said Then I uninstalled apache and re-installed it from normal user, how did you install apache in this case? Because if you were installing it with apt-get, it cannot be done without root privileges.
    – Dan
    Feb 18, 2016 at 14:57

1 Answer 1

0

Do

ls -l in the directory where index.html

is residing

Find out the file permissions for that.

You could very well done this

sudo gedit index.html

make the change and it will work

You need to make use of the command

chown ashish:ashish or
chown ashish:root

to change the onwership of the files in that directory

1
  • You shouldn't run gui apps with sudo
    – Dan
    Feb 18, 2016 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .