Saturday, 22 June 2019

How to install XAMPP Server on CentOS 7



XAMPP is an open source multi-platform software stack. It contains Apache, MariaDB, PHP and Perl and provides a suitable environment for testing Apache MYSQL, PHP and Perl projects.
Step 1: The package is not available in Centos 7 default repository. Download latest stable XAMPP binary from the site for Linux distribution.

Note: If wget is not installed follow the steps How to resolve wget: command not found.

[root@linuxcnf ~]# wget https://www.apachefriends.org/xampp-files/7.3.6/xampp-linux-x64-7.3.6-2-installer.run
--2019-06-22 22:40:22--  https://www.apachefriends.org/xampp-files/7.3.6/xampp-linux-x64-7.3.6-2-installer.run
Resolving www.apachefriends.org (www.apachefriends.org)... 3.215.101.154, 107.21.20.65, 52.45.45.221
Connecting to www.apachefriends.org (www.apachefriends.org)|3.215.101.154|:443... connected.
…………………………..
2019-06-22 22:46:40 (401 KB/s) - ‘xampp-linux-x64-7.3.6-2-installer.run’ saved [154774218/154774218]

[root@linuxcnf ~]#

Step 2: Change permission to executable for the downloaded file:

[root@linuxcnf ~]# ls -ld xampp-linux-x64-7.3.6-2-installation.run
-rw-r--r--. 1 root root 154774218 Jun 20 20:25 xampp-linux-x64-7.3.6-2-installer.run
[root@linuxcnf ~]# chmod 755 xampp-linux-x64-7.3.6-2-installation.run
[root@linuxcnf ~]# ls -ld xampp-linux-x64-7.3.6-2-installation.run
-rwxr-xr-x. 1 root root 154774218 Jun 20 20:25 xampp-linux-x64-7.3.6-2-installer.run
[root@linuxcnf ~]#

Step 3: Run the XAMPP installer script and follow the steps:

[root@linuxcnf ~]# ./xampp-linux-x64-7.3.6-2-installation.run
----------------------------------------------------------------------------
Welcome to the XAMPP Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

XAMPP Core Files : Y (Cannot be edited)

XAMPP Developer Files [Y/n] :y

Is the selection above correct? [Y/n]: y

----------------------------------------------------------------------------
Installation Directory

XAMPP will be installed to /opt/lampp
Press [Enter] to continue:

----------------------------------------------------------------------------
Setup is now ready to begin installing XAMPP on your computer.

Do you want to continue? [Y/n]: y

----------------------------------------------------------------------------
Please wait while Setup installs XAMPP on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing XAMPP on your computer.

[root@linuxcnf ~]#


Step 4: Open the apache configuration file /opt/lamp/etc/extra/httpd-xampp.conf and replace a line ‘Require local’ with ‘Require all granted’ to XAMPP Server access to everyone if needed.

[root@linuxcnf ~]# vi /opt/lampp/etc/extra/httpd-xampp.conf
…………………
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Step 5: Allow from firewall to access the httpd service:

[root@linuxcnf ~]# firewall-cmd --permanent --add-port=80/tcp
success
[root@linuxcnf ~]# firewall-cmd --reload
success
[root@linuxcnf ~]#

Step 6: Finally, restart the lampp service to reload the configuration:

[root@linuxcnf ~]# /opt/lampp/lampp restart
Restarting XAMPP for Linux 7.3.6-2...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...not running.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
[root@linuxcnf ~]#

Now open the url <<http://192.168.43.105/>> in Web browser to access xampp server and <<http://192.168.43.105/phpmyadmin/>> to access phpmyadmin.

No comments:

Post a Comment