ubuntu

easy installing XAMPP 1.8.1 in ubuntu12.10


reference :  http://www.upubuntu.com/2012/10/install-xampp-181-from-ppa-under-ubuntu.html

Fire up new terminal. enter following command.

  1. sudo add-apt-repository ppa:upubuntu-com/xampp
  2. sudo apt-get update
  3. sudo apt-get install xampp

You can now start XAMPP with this command:

  1. sudo /opt/lampp/lampp start

Or use Unity dash and search for XAMPP Control Panel and start the server:

You can now access the XAMPP web interface at this link (replace localhost with your server IP address if needed):

http://localhost/xampp/

Troubleshooting

If you get this error when accessing phpMyAdmin:

Access forbidden!
New XAMPP security concept:
Access to the requested directory is only available from the local network.This setting can be configured in the file “httpd-xampp.conf”.

You can fix it with the following instructions:

– Open the terminal and run this command:

sudo gedit /opt/lampp/etc/extra/httpd-xampp.conf

– Replace now these lines:

<Directory “/opt/lampp/phpmyadmin”>
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
</Directory>

with these lines:

<Directory “/opt/lampp/phpmyadmin”>
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

– Save your file and exit, then restart XAMPP with this command:

 sudo /opt/lampp/lampp restart

//======================= setting permission on httpdocs =================================================

You are mistaking how chmod and the unix file permissions operate.

You need to configure the /opt/lampp/htdocs directory so that the user you are logged in as has permission to write. You also need to ensure that what you write in there can be read by whatever web server LAMPP uses (I’m not familiar with LAMP unfortunately.)

First you need to look at who is owning /opt/lampp/htdocs:

$ ls -ld /opt/lampp/htdocs

Should return something like:

drwxr-xr-x 4 lampp www 4096 2011-03-22 12:43 /opt/lampp/htdocs

The first bit (dwrxr-xr-x) is the file permissions. “lampp” is the owner of the directory, and “www” is the group-owner of the directory. You need to note this one.

First off let’s sort the group. If the group is anything except “root” then all is well and good and you can skip this section:

If it’s “root” it will need changing to something more sensible. Let’s make a new group for it to belong to:

$ sudo groupadd www

Then change the group on the directory:

$ sudo chgrp -R www /opt/lampp/htdocs

Now you need to make the web server run as the group www. If the web server is Apache then you should check the /etc/apache/httpd.conf file and edit the “Group” setting accordingly. I don’t know the setting for other web servers.

Now this is where you’d skip to if you didn’t need to switch the group from root to something else.

We now need to address the permissions on the directory. We want to be using some very special permissions, called the “setgid” bit.

$ sudo chmod 2775 /opt/lampp/htdocs
$ ls -ld /opt/lampp/htdocs
drwxrwsr-x 4 lampp www 4096 2011-03-22 12:43 /opt/lampp/htdocs

You see the permissions have now changed somewhat. Let’s explain these.

  • The first letter is the file type. In this case “d” is for Directory.
  • The next three, “rwx” are the permissions the owner (lampp) has on the directort. r = read, w=write and x=see the directory contents.
  • The next three, “rws” are for the group-owner (www), but you notice the x in this case is actually an s – we will come to that in a moment.
  • The last three, “r-x”, are for everybody else. That is read, and see the content of the directory. No writing.

The “s” in the group permissions is called the “setgid” bit. This is a special permission which causes any files created in the directory to inherit the group-owner from the directory itself. So if user “fred” in group “users” makes a file in there it would be owned by “fred” in group “www”. This is very useful for a shared area where multiple people all read and write the same files.

But as it stands you still don’t have the ability to write to that area. Why? Because you’re not in the “www” group. Let’s rectify that now:

$ sudo usermod -aG www <user_name>

Replace “www” with the group-owner of the /opt/lampp/htdocs directory you noted near the beginning.

You will need to log out and in again for this change to take effect – your group memberships are read at login time.

Once you have done that you should suddenly find you can now magically write files in /opt/lampp/htdocs.

If you have other users on the system that you want to allow to write to there, just add them to the www group with the usermod -aD www <username> command.

enjoy.

cheers

Advertisements

4 thoughts on “easy installing XAMPP 1.8.1 in ubuntu12.10”

  1. I do not leave many comments, however after
    looking at some of the remarks here easy installing XAMPP 1.
    8.1 in ubuntu12.10 | Niroze’s Weblog. I actually do have a couple of questions for you if it’s allright.
    Could it be just me or does it look as if like some of these responses come across as if
    they are written by brain dead people? 😛 And, if you are
    writing at other online sites, I’d like to follow you. Would you list of every one of your social community pages like your linkedin profile, Facebook page or twitter feed?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s