Installing XAMPP on ubuntu

sudo chmod +x xampp-linux-x64-7.4.6-0-installer.run
  • Now run the file using below command
sudo ./xampp-linux-x64-7.4.6-0-installer.run

Xampp will be installed at below location

/opt/lampp

Starts xampp control panel using below command :

sudo /opt/lampp/manager-linux-x64.run

Starts all the servers and test the below urls to check if everything is installed correctly :

http://localhost/dashboard/
http://localhost/phpmyadmin/

htdocs location :

/opt/lampp/htdocs

Uninstall Xamp/Lamp

sudo /opt/lampp/uninstall
sudo rm -r /opt/lampp

Installing wordpress of XAMPP

Download the latest wordpress files using below command

wget -c http://wordpress.org/latest.tar.gz

Unzip it and copy into htdocs directory

tar -xzvf latest.tar.gz
sudo rsync -av wordpress/* /opt/lampp/htdocs/

Identify the username/user of the webserver we need to run the below command

ps aux | grep httpd

Change the owner of the wordpress directory and give it permissions as below

sudo chown -R daemon /opt/lampp/htdocs/wordpress/
sudo chown daemon /opt/lampp/htdocs/
sudo chmod -R 755 wordpress/

Setup the XAMPP secuirty using below command, setup the root password


Navigate to below URL and create a db named wordpress

http://localhost/phpmyadmin

Now we need to create a copy of wp-config.php file and edit the database details in it

sudo cp /opt/lampp/htdocs/wordpress/wp-config-sample.php /opt/lampp/htdocs/wordpress/wp-config.php
sudo vi /opt/lampp/htdocs/wordpress/wp-config.php
	define( 'DB_NAME', 'wordpress' );
	define( 'DB_USER', 'root' );
	define( 'DB_PASSWORD', '' );
	define( 'DB_HOST', 'localhost' );

Now you can restart the webserver once and navigate to below URL to start configuring the wordpress :

http://localhost/wordpress/wp-admin/install.php

Leave a Comment