2

I am a new Linux/Ubuntu user and I'm trying to set up an easy local Web Development Server. For now I just need Apache. I don't want a LAMP bundle (Like XAMPP - I have a 32-bit architecture) and I don't need PHP and MySQL for now.

I like to do things from scratch and the terminal way. So far I have installed apache. Localhost or 127.0.0.1 runs fine and I have added some files to the root directory /var/www/html. I could create a sub-category and an index.html file under /var/www/html (every time I did, I had to use sudo to do that, even though I was signed in as root.)

I also installed Atom as a Text Editor, but Atom can't save my files due to some access restrictions/permissions. Every time I solve an issue another problem occurs. What should I do now?

So much to know about Linux, so much to configure there, my brain is tired of googling and searching for answers that do not really much my questions. I think I need some help here.

guntbert
  • 13,134
Artskee
  • 21

1 Answers1

1

It's generally a bad idea to log in as root. Instead, you should use sudo.

(Note: normally you can't use su root to become root since Ubuntu locks the root account by default.)

Try launching Atom from the command-line with gksudo atom (gksudo is the equivalent of sudo for GUI programs, if you don't have it just running sudo should also work). This should allow you to save to /var/www/html without any problems.

However, since saving to the wrong file could mess up your system, it's a bad idea to use sudo all the time. This answer has some guides on how to avoid using sudo in /var/www/html/ (after which launching Atom normally should work just fine).

  • Beacuse gksudo is not installed I have tried sudo atom, that run Atom with the privileges. I am now able to create and edit files. Do I have always to start atom from the CLI using sudo? opening it through the search bar would be easier and quicker (I will have a look at your link). – Artskee Nov 22 '16 at 17:37
  • 1
    @Artskee As long as you don't have the proper permissions in /var/www/html, yes. However, if you follow the guide in my post above, it will give you the necessary permissions and then you can open it from the search bar. – ASCIIThenANSI Nov 22 '16 at 17:39