0

I'm new to this ubuntu 13.04 so in terminal i allways need to start my xampp as a root so please help me i wanna convert my current account as an administrator(root) user.

3
  • why not to use sudo to do the same just use sudo <command> this will execute the command as super user.
    – Tarun
    Sep 10, 2013 at 7:54
  • You might wanna move the xampp folder into your HOME directory. Normally you do not need administrative rights to start it.
    – JJD
    Sep 10, 2013 at 7:54
  • 1
    @JJD: oh yes, you do; the servers run as different users, and you need root privileges to change into them.
    – January
    Sep 10, 2013 at 8:02

1 Answer 1

3

First things first. You should not work and run your desktop as root. Full stop. It is a bad, bad idea. Especially if you want to run a web server. Forget about it. It is easy enough to do it: set a root password (sudo -i ; then: passwd) and log in as user root. But don't do it, there are better ways around it.

To start a web server (and xampp is just a bundle containing a web server, sql server and a few other things that you could have installed on your machine easily with your package manager), you need root privileges for a brief moment only. This is why you use sudo -- to become root for just the moment when your run the command. For example, if you have followed these instructions to install xampp, you can just run

sudo /opt/lampp/lampp start

If you are tired of typing in commands, create a desktop shortcut as described in the link above. If you are tired of typing in the password, edit your sudoers file. Type

sudo visudo

And at the end of that file, add the following line:

humanth ALL = NOPASSWD: /opt/lampp/lampp

(assuming that you start lampp as above and that humanth is your user name).

Furthermore, did you even read the Linux XAMPP HOWTO? It shows very clearly how to set up XAMPP as a service, so that you do not need to start it manually. In esssence, you just link the /opt/lampp/lampp script to /etc/init.d.

sudo -i
cd /etc/rc.d/rc3.d
ln -s /opt/lampp/lampp S99lampp
ln -s /opt/lampp/lampp K01lampp

You must log in to answer this question.

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