Setting up a LAMP server (Linux, Apache, MySQL, phpMyAdmin) on Ubuntu 22.10

I'm assuming you have a fresh, vanilla installation of Ubuntu 22.10 with only the base operating system.

First, lets install Apache, MySQL, and PHP, if not already installed. This can be achieved with a one-line command:

    sudo apt-get install apache2 mysql-server php libapache2-mod-php phpmyadmin

Start the Apache2 and MySQL service:

    sudo systemctl start apache2 mysql 

Run the MySQL security script:

    sudo mysql_secure_installation

Test the Apache installation by navigating to http://<ip_address> in your web browser, and you should see a default web page.

Create a test PHP file in the Apache web root directory:

    sudo nano /var/www/html/info.php

Add the following code to the file:

    <?php
        phpinfo();
    ?>

Test the PHP installation is functioning correct by navigating to http://<ip_address>/info.php in your web browser.

Test that you can access the phpMyAdmin login page by navigating to the following address:

    http://<ip_address>/phpmyadmin/

That's about it. Type in your MySQL username and password and you should be logged into phpMyAdmin.


While there are a ton of other configuration options for all of the three software packages we've just installed, I'm going to stop here as it can get quite involved with a myriad of options available.

If you want to set up individual aspects of each package, such as securing your connections with security certificates and installing additional PHP modules, enabling virtual hosting and configuration,  have a look at some of the other tutorials.

If you can't browse to your web server you may need to open ports in your firewall.
Name

false
ltr
static_page
Tech Lab: Setting up a LAMP server (Linux, Apache, MySQL, phpMyAdmin) on Ubuntu 22.10
Setting up a LAMP server (Linux, Apache, MySQL, phpMyAdmin) on Ubuntu 22.10
Tech Lab
https://techlab.connektiv8.com/p/how-to-set-up-lamp-server-on-ubuntu-2210.html
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/p/how-to-set-up-lamp-server-on-ubuntu-2210.html
true
5093225316588518036
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network