Ubuntu Linux: Apache PHP5 and MySQL Installation And Configuration

Ubuntu Linux: Apache PHP5 and MySQL Installation And Configuration

To install Apache, PHP5, and MySQL on Ubuntu Linux and configure them to work together, you can use the following steps:

  1. Update the package list by running the following command:
sudo apt-get update
Sou‮www:ecr‬.lautturi.com
  1. Install Apache, PHP5, and MySQL by running the following command:
sudo apt-get install apache2 mysql-server php5-mysql php5 libapache2-mod-php5

This will install Apache, PHP5, and MySQL and configure Apache to use PHP5.

  1. Once the installation is complete, start the Apache and MySQL services by running the following commands:
sudo service apache2 start
sudo service mysql start
  1. To configure MySQL, you will need to set a root password for the MySQL server. Run the following command to set the root password:
mysql_secure_installation

Follow the prompts to set the root password and configure the MySQL server.

  1. To test the Apache and PHP5 configuration, you can create a PHP script in the Apache document root (typically /var/www/html). For example, create a file called info.php with the following contents:
<?php
phpinfo();
?>
  1. Save the file and then access it in a web browser by visiting http://localhost/info.php. This should display the PHP information page, indicating that Apache and PHP5 are working correctly.

That's it! Apache, PHP5, and MySQL should now be installed and configured on your Ubuntu Linux system.

Keep in mind that this is a basic installation and configuration of Apache, PHP5, and MySQL. You can customize the configuration by modifying the Apache and PHP5 configuration files, and by creating and modifying MySQL databases and users.

Created Time:2017-10-30 14:27:27  Author:lautturi