Installing lamp (Linux, Apache, mariadb and PHP) on Fedora Server and workstation

Source: Internet
Author: User
Tags install php strong password

before installing lamp, it is recommended to update the System package first
$ sudo DNF update

First step: Install the Apache Web server
1. Install Apache in Fedora 23 and you can run the following command:
$ sudo DNF install httpd
2. After the installation is complete, we set the Apache to start automatically when the system starts, and then we will start to verify the status of Apache. Run the following series of commands:
$ sudo systemctl enable Httpd.service
$ sudo systemctl start httpd
$ sudo systemctl status httpd
3. Run the Web server over HTTP and HTTPS and add the following rules to the Fedora Firewall:
$ sudo firewall-cmd--permanent--add-service=http
$ sudo firewall-cmd--permanent--add-service=https
4. Now to verify
$ IP A | grep inet //Get system IP address
Open the browser at address input:/ http/Your IP address .
NOTE: The default Apache directory /var/www/html/

Step Two: Install the MARIADB server
5. Install mariadb in Fedora 23 and run the following command:
$ sudo DNF install Mariadb-server
6. After the installation is complete, we set the MARIADB to start automatically when the system starts, and then we will start verifying the status of the mariadb. Run the following series of commands:
# sudo systemctl enable mariadb
# sudo systemctl start mariadb
# sudo systemctl status mariadb
7. Several settings need to be adjusted to ensure the installation of your mariadb. To change this setting, we recommend that you run the following command:
# sudo mysql_secure_installation
Here's what you need to do:

    • Ask for the root password of MySQL and leave it blank . There is no default password.
    • Then be asked to enter a new mariadb root password, be sure to enter a strong password.
    • Prompts you later whether to delete the anonymous user prompt for mariadb. This user is not, select "y".
    • Next, you need to disable root remote access to the database and select "y". You can create a separate user for each database so that you can access the database you want.
    • You will then be asked if you want to delete the "test" database that was created in the installation mariadb, this database is not required, so you can delete it and select "y".
    • Finally, select whether to reload the table and select "y".

Step three: Install PHP
8. Install PHP in Fedora 23 and you will need to run the following command:
$ sudo dnf install PHP Php-common
9. Next you need to install the PHP module to run the Php/mysql application, using the following command
$ sudo DNF install php-mysql php-pdo php-gd php-mbstring
10. Once the installation is complete, restart Apache to start applying PHP:
$ sudo systemctl restart httpd
11. Let's test and create the info.php file in /var/www/html , you can use the command:
$ cd/var/www/html
$ nano info.php
Enter the following code:
<?php
phpinfo ()
?>
Save the file, go back to the browser, dial in http:// your IP address/info.php, and now you should be able to see the PHP information page.

Installing lamp (Linux, Apache, mariadb and PHP) on Fedora Server and workstation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.