If you have installed Xampp in Ubuntu. The first time you try running Xampp services using sudo /opt/lampp/lampp start and see that apache services is not starting, Don't panic it's because you already have an instance of Apache 2 running. And am talking about Apache 2 instance in Ubuntu 14.04 LTS version because that's the one I am using. I do not have idea about previous versions and am pretty sure that they have included Apache in the later versions in Ubuntu till now.
So before you start using Xampp services, what you want to check is if you already have an instance of Apache running. You can do that by opening a browser and try visiting http://localhost/. You can see an Ubuntu Apache Page. If you see one then you know for sure that you have an Apache 2 running. Now you can use this instance for your projects. But if you don't want to and want to use Xampp's Apache then open terminal and type in sudo /etc/init.d/apache2 stop. This should do the trick. Open the browser and try visiting localhost again if you see a Problem page then you are successful in stopping Ubuntu's Apache Instance. Now in terminal type in sudo /opt/lampp/lampp start to start Xampp's services and open http://localhost/. You should be able to see a Xampp welcome page now. You can acess phpMyadmin to see the Databases. To stop Xampp services type sudo /opt/lampp/lampp stop.
The default user name for MySQL services is root and password is empty i.e. ''. So to change that open your terminal and type in /opt/lampp/bin/mysqladmin --user=root password "gue55me" where gue55me is your password. Ensure that your MySQL server is running while you are changing your password. There is one issue after you do this. Try going for localhost again and click on phpMyAdmin tab and you will see an error not allowing you to use MySQL services. Well we have a solution for that too. Navigate to your Xampp installation directory i.e. /opt/lampp/phpmyadmin. open a terminal there(Right Click) and type sudo gedit config.inc.php .Provide your password(Your Ubuntu user password) and hit Enter. Now you'll see a configuration file. Find a line in that file like this $cfg['Servers'][$i]['password'] = ''; and provide your Xampp MySql password inside quotes like this $cfg['Servers'][$i]['password'] = 'password';. Save and Exit and you are done now. To confirm if everything is working visit localhost and try accessing phpMyadmin tab. If you do not find any issues, give yourself a pat and enjoy Xampp services.