Fedora 23 How to install the lamp server

Source: Internet
Author: User

LAMP is a fantastic combination of WEB servers on open source systems. LAMP is the abbreviation for Linux, Apache HTTP service, MYSQL/MARIADB database, and PHP, Perl, or Python.

Here's how to install the LAMP combination on a Fedora 23 server.

The following tutorial uses the 192.168.1.102/24 instance by default, please follow your server to make changes.

Installing Apache

Apache is an open-source Web services framework. Full support for CGI, SSL.

Switch to root account: Sufedora 23/22 Enter the following command to install Apache:dnf?install?httpd?-yfedora 21 and earlier: Yum?install?httpd?-y start the httpd service, To start the service on each system: SYSTEMCTL?ENABLE?HTTPD use the following command to start the HTTPD service: SYSTEMCTL?START?HTTPD

If you encounter the following error:

Job for Httpd.service failed. See ' systemctl status Httpd.service ' and ' journalctl-xn ' for details.

Delete all content in/etc/hostname, and add "localhost". Also, the value of "Servername" in the/etc/httpd/conf/httpd.conf file is set to "localhost" and attempts to start the httpd service again.

and adjust the firewall to allow HTTPD services to be accessed from remote clients.

Firewall-cmd?--Permanent?--add-service=httpfirewall-cmd?--permanent?--Add-service=https

Restart the FIREWALLD service:

Firewall-cmd?--Reload

Open the browser and enter the server IP access:

Installing MariaDB

Fedora 23/22 User Installation commands:

Dnf?install?mariadb?mariadb-server?-y

Fedora 21 earlier Version command:

Yum?install?mariadb?mariadb-server?-y

Automatic start command with system:

Systemctl?enable?mariadb

Start the database server:

Systemctl?start?mariadb

Set the MariaDB root account password, by default the MySQL root user's password is empty. Therefore, to prevent unauthorized access to the MySQL database, we set the need for the root user password:

Mysql_secure_installation

Note:running all PARTS of this SCRIPT are RECOMMENDED for all MariaDB

SERVERS in PRODUCTION use! Please READ each STEP carefully!

In order to log into MariaDB to secure it, we'll need the current

Password for the root user. If you ' ve just installed MariaDB, and

You haven ' t set the root password yet, the password would be blank,

So, should just press ENTER here.

Enter current password to root (enter for none):

OK, successfully used password, moving on ...

Setting The root password ensures that nobody can log into the MariaDB

Root user without the proper authorisation.

You already has a root password set so that you can safely answer ' n '.

Change the root password? [y/n] y # # Enter ' y ' and press Enter # #

New Password: # # Enter Password # #

Re-enter new password: # # re-enter Password # #

Password Updated successfully!

Reloading privilege tables.

... success!

By default, a MariaDB installation have an anonymous user, allowing anyone

To log into MariaDB without has to has a user account created for

them. This was intended only for testing, and the installation

Go a bit smoother. You should remove them before moving into a

Production environment.

Remove anonymous users? [y/n] # # Press Enter # #

... success!

Normally, Root should only is allowed to connect from ' localhost '. This

Ensures that someone cannot guess at the root of password from the network.

Disallow Root login remotely? [y/n] # # Press Enter # #

... success!

By default, MariaDB comes with a database named ' test ' that anyone can

Access. This was also intended only for testing, and should be removed

Before moving into a production environment.

Remove test database and access to it? [y/n] # # Press Enter # #

–dropping Test Database ...

ERROR 1008 (HY000) at line 1:can ' t drop database ' test '; Database doesn ' t exist

... failed! Not critical, keep moving ...

–removing privileges on test database ...

... success!

Reloading the privilege tables would ensure that all changes made so far

would take effect immediately.

Reload privilege tables now? [y/n] # # Press Enter # #

... success!

Cleaning up ...

All done! If you ' ve completed all of the above steps, your MariaDB

Installation should now is secure.

Thanks for using mariadb!

Install PHP

Fedora 23/22 user command:

Dnf?install?php?-y

Fedora 21 and Previous versions:

Yum?install?php?-y

To test if PHP is running:

vi?/var/www/html/testphp.php

Enter the following:

<?phpphpinfo ();? >

To restart the Http service:

Systemctl?restart?httpd

Browser input look at:

Installing the PHP module

Search for modules and install:

Fedora 23/22 Users:

dnf?search?php

Fedora 22 and Previous versions:

yum?search?php

Now install the required modules of your choice, such as Php-mysql, using the following command:

Fedora 23/22 Users:

Dnf?install?php-mysql?-y

Fedora 22 and Previous versions:

Yum?install?php-mysql?-y

To restart the HTTP service:

Systemctl?restart?httpd

Browser to see if the module installation was successful:

Installing PhpMyAdmin

phpMyAdmin for managing Databases:

Fedora 23/22 Users:

Dnf?install?phpmyadmin?-y

Fedora 22 and Previous versions:

Yum?install?phpmyadmin?-y

By default, phpMyAdmin can only be accessed from a local host. To access your network from a remote system, follow these steps.

Vi?/etc/httpd/conf.d/phpmyadmin.conf

Find and comment out 127.0.0.1 and request IP:: 1 lines. Then add an extra line that requires all grants just below the comment line.

This is my phpmyadmin.conf file after the change. These changes are marked in bold.

[...] Alias?/phpmyadmin?/usr/share/phpmyadminalias?/phpmyadmin?/usr/share/phpmyadmin<directory?/usr/share/ Phpmyadmin/>??? Adddefaultcharset? UTF-8??? <IfModule?mod_authz_core.c>????? #? apache?2.4????? <requireany>#??????? require?ip?127.0.0.1#??????? Require?ip?::1???????? require?all?granted????? </RequireAny>??? </IfModule>??? <ifmodule?! mod_authz_core.c>????? #? apache?2.2????? Order? Deny,allow????? Deny?from? All????? allow?from?127.0.0.1????? Allow?from?::1??? </IfModule></Directory><Directory?/usr/share/phpMyAdmin/setup/>??? <IfModule?mod_authz_core.c>????? #? apache?2.4????? <requireany>#??????? require?ip?127.0.0.1#??????? Require?ip?::1???????? require?all?granted????? </RequireAny>??? </IfModule>??? <ifmodule?! Mod_authz_core.c>[...]

Important: However, accessing the database from someone other than localhost should be considered dangerous unless properly protected by SSL. Doing this requires you to be at your own risk.

Save and close the file. Restart the httpd service.

Systemctl?restart?httpd

OK, open the phpMyAdmin test for a moment:

All right, the installation is complete!

Free to provide the latest Linux technology tutorials Books, for open-source technology enthusiasts to do more and better: http://www.linuxprobe.com/

Fedora 23 How to install the lamp server

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.