Build a XAMPP environment on Ubuntu

Introduction

Operating environment

XAMPP installation

First, install XAMPP.

  1. Access the following site. https://www.apachefriends.org/jp/index.html

  2. Click XAMPP for Linux. ⇒ The XAMPP installer "xampp-linux-x64-7.4.8-0-installer.run" will be downloaded.

  3. Launch the installer. (By default, it will be installed in / opt / lampp.)

    $ sudo ./xampp-linux-x64-7.4.8-0-installer.run
    

[sudo] ubuntu password: ---------------------------------------------------------------------------- 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) ★ Press the "y" key.

XAMPP Developer Files [Y / n]: y ★ Press the "y" key.

Is the selection above correct? [Y / n]: y ★ Press the "y" key.

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

XAMPP will be installed to /opt/lampp

Press [Enter] to continue: ★ Press the "Enter" key.

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

Do you want to continue? [Y / n]: y ★ Press the "y" key.

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

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

----------------------------------------------------------------------------
Setup has finished installing XAMPP on your computer.
~~~
  1. Make sure it is installed in / opt / lampp.

    $ ls /opt/lampp/
    README-wsrep  ctlscript.sh  info      manager-linux-x64.run  properties.ini
    README.md     docs          lampp     manual                 sbin
    RELEASENOTES  error         lib       modules                share
    THIRDPARTY    etc           lib64     mysql                  temp
    apache2       htdocs        libexec   pear                   uninstall
    bin           icons         licenses  php                    uninstall.dat
    build         img           logs      phpmyadmin             var
    cgi-bin       include       man       proftpd                xampp
    
  2. Install the tools needed to run XAMPP.

    $ sudo apt-get install net-tools
    

phpMyAdmin settings

Next, configure phpMyAdmin settings.

  1. Set it so that it can be accessed from other machines.

    $ sudo nano /opt/lampp/etc/extra/httpd-xampp.conf
    

【Change before】 <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Require local ★ Before change ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var ~~~

~~~

[After change] <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Require all granted ★ After change ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var ~~~

Start phpMyAdmin

Start phpMyAdmin.

  1. If you have Apache, MySQL, or ProFTPD running, you need to stop it.

[Example] For Apache $ sudo systemctl stop apache2 ~~~

  1. Start XAMPP. (If you get an error saying "already running", it may work after rebooting.)

    $ sudo /opt/lampp/lampp start
    
    $ sudo /opt/lampp/lampp restart
    
  2. Start your browser and access the following URL to open "phpMyAdmin". http://{UbuntuのIPアドレス}/phpmyadmin/

  3. Stop XAMPP.

    $ sudo /opt/lampp/lampp stop
    

Password setting

Set the password to access the database.

  1. Open the User Accounts tab in phpMyAdmin.

  2. Press the "Change Password" button in phpMyAdmin, change the password and press the "Run" button.

  3. Open the phpMyAdmin configuration file (config.inc.php) and enter the password you set in the ★ section below.

    $ sudo nano /opt/lampp/phpmyadmin/config.inc.php
    
    /* Authentication type and info */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    

$ cfg ['Servers'] [$ i] ['password'] ='****'; ★ Enter the password you set. cfg['Servers'][i]['extension'] = 'mysqli'; cfg['Servers'][i]['AllowNoPassword'] = true; $cfg['Lang'] = ''; ~~~

  1. Make sure that the User Accounts tab in phpMyAdmin opens. (If the password cannot be set in config.inc.php, an error will occur.)

Database creation

Create a database.

  1. Open the Import tab in phpMyAdmin.

  2. Click the "Browse" button on the right side of the upload field, select the following SQL file, and click the "Execute" button to register the database of the user account. (Leave all the default settings.)

/ * Create sample database * / create database sample;

/ * Use sample database * / use sample;

/ * Create account table * / CREATE TABLE sample.account ( username CHAR(20) NOT NULL, password CHAR(20) NOT NULL, mailaddr CHAR(30) NOT NULL, PRIMARY KEY ( username ) );

/ * Register user account information in the account table * / INSERT INTO sample.account (username, password, mailaddr) VALUES ('Yamada','yamada','[email protected]'); INSERT INTO sample.account (username, password, mailaddr) VALUES ('jun','jun','[email protected]'); INSERT INTO sample.account (username, password, mailaddr) VALUES ('Aiko','aiko','[email protected]'); INSERT INTO sample.account (username, password, mailaddr) VALUES ('Michael', 'michael', '[email protected]'); ~~~

  1. Click sample> account in the tree on the left side of phpMyAdmin. ⇒ You can confirm that the account table is registered in the sample database.

Database operations

This is an example of operating a database.

  1. Open the "SQL" tab in phpMyAdmin, enter the SQL statement and press the "Execute" button.

  2. The execution result is displayed.

Recommended Posts

Build a XAMPP environment on Ubuntu
How to build a Pytorch environment on Ubuntu
[Ruby] Building a Ruby development environment on Ubuntu
Build a Java development environment on Mac
Build a JMeter environment on your Mac
Build Zabbix on Ubuntu 20.04
[Java] Build Java development environment on Ubuntu & check execution
Build a DHCP and NAT router on Ubuntu 16.04
Build a Laravel environment on an AWS instance
Build a Java runtime environment on Sakura VPS
Build VNC Server on Ubuntu 20.04
Ubuntu on Windows build speed
Ruby ① Build a Windows environment
Memo to build a Servlet environment on AWS EC2
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
Build a Ruby on Rails development environment on AWS Cloud9
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
Build a Node.js environment with Docker
Build a Tomcat 8.5 environment with Pleiades 4.8
Build the latest Samba 4 on Ubuntu 20.04
Build a Minecraft server on AWS
Build a CentOS 8 virtual environment on your Mac with VirtualBox
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
How to build vim on Ubuntu 20.04
Build ffmpeg 4.3.1 on Ubuntu for Windows
Build Unity development environment on docker
A story of frustration trying to create a penetration environment on Ubuntu 20.04
Build a development environment where Ruby on Rails breakpoints work on Windows
[Introduction] Build a virtual environment of Vagrant + VirtualBox on Window10 [Environment construction]
Create a development environment for Ruby 3.0.0 and Rails 6.1.0 on Ubuntu 20.04.1 LTS
Steps to build a Ruby on Rails development environment with Vagrant
Building a Deep Learning environment (Ubuntu 20.04 LTS)
Use docker in proxy environment on ubuntu 20.04.1
Build a WAS execution environment from Docker
Build a Maven repository on AWS S3
Build Java 8 development environment on AWS Cloud9
Build a Wordpress development environment with Docker
Build Redmine code reading environment on Docker
Build OpenCV with Java Wrapper on Ubuntu 18.04
Build Cakephp environment from docker installation Ubuntu
Build an environment with Docker on AWS
Build an Ultra96v2 development environment on Docker 1
Build a simple Docker + Django development environment
How to build a Ruby on Rails environment using Docker (for Docker beginners)
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
Build a development environment on AWS EC2 with CentOS7 + Nginx + pm2 + Nuxt.js
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Template: Build a Ruby / Rails development environment with a Docker container (Ubuntu version)
tmux on Ubuntu
Build a development environment for Docker + Rails6 + Postgresql
Try running ScalarDB on WSL Ubuntu (Environment Construction)
Build a test flow on CircleCI using Jib
Try to build Java8 environment on Amazon Linux2
Protobuf and gRPC C ++ environment construction on Ubuntu 18.04
Write a dockerfile to start jupyter-lab on ubuntu
Building a Hadoop cluster (Cloudera Manager on Ubuntu 18.04)
Building a Ruby environment for classes on Mac
Build a WordPress development environment quickly with Docker
Build Apache / Tomcat development environment on Cent OS 7
Build a streaming server on your iOS app
Build a simple Docker Compose + Django development environment