Monday, November 5, 2012

Resolving "New XAMPP security concept" issue and opening phpMyAdmin console

Environment : Ubuntu 12.04 (Linux)

I was going to open the phpMyAdmin console after starting XAMPP server 1.8.1 where i was greeted with the following error message :D



Eventhough i was first confused, resolving this issue was not hard after having some web search. This is how to get it done.

As the error message informs first we have to find "httpd-xampp.conf" file. It is in the /opt/lampp/etc/extra directory. Open this file with root permission as we are going to edit it.

Note: /opt/lampp is the installation folder where i installed my XAMPP distribution. If you have installed it in another location go there and get into LAMPP_HOME/etc/extra directory.

Find the following section in the file.
<Directory "/opt/lampp/phpmyadmin">
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
</Directory>

The error can be fixed by adding the following line in within the <Directory> tags.

Require all granted

So the edited section would look like,
<Directory "/opt/lampp/phpmyadmin">
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

Now click on phpMyAdmin link, the console will be opened now.



How to install XAMPP correctly in Linux (Ubuntu 12.04)


When you want to install Apache 2.0 server to try and test your services in the local computer, Apache XAMPP is an easy and straightforward solution which comes with combined MySQL and PHP packages.  Following is what you should do to install and run XAMPP in your computer.

1. Download latest version(or an older version if you need) of XAMPP from the 'XAMPP for Linux' page.

2. Use the following command and extract the downloaded distribution into /opt directory.

               sudo tar xvfz xampp-linux-1.8.1.tar.gz  -C /opt

You can replace xampp-linux-1.8.1.tar.gz with the version you have.

3. This will extract the content of XAMPP directory into /opt/lampp/. Now let's start the XAMPP server. Use the following command.
  
               sudo /opt/lampp/lampp start 

If all the configurations are correct XAMPP server will start now as follows.

Starting XAMPP for Linux 1.8.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.


 4. Goto http://localhost from your browser and test whether this is correctly installed and started. You will be first directed to the language selection page and then the welcome page would be appeared as shown below.

XAMPP welcome page
 
 5. Stop the server when you are done :)


               sudo /opt/lampp/lampp stop 

 ...................................................................................................................................................

If everything goes fine as this you are good to go. However there may be times when you get error messages like this.

Starting XAMPP for Linux 1.8.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Another MySQL daemon is already running.
XAMPP: Starting ProFTPD...
XAMPP for Linux started.


What this means is that XAMPP-MySQL is not started as you have another mysql-server instance is running in your local computer. Most probably you may have installed mysql-server-5.0 (or older version) previously into your computer. Therefore to start MySQL in XAMPP distribution we have to first stop this service. Use the following command.

            sudo service mysql stop  

The running mysql service will be stopped. Simple start the XAMPP server back and problem is fixed now :) Do the same and stop the apache2 service if you see that Apache server too hasn't started.

XAMPP: Another web server daemon is already running.
Use,     sudo service apache2 stop