Install the LAMP host server on Fedora21

Source: Internet
Author: User
Not long ago, Fedora21 was released. There are three versions, one of which is the Server version. The original Article prompts that the Server version is used, let's take a look at LAMP as short for Linux, Apache, MySQL/MariaDB, and PHP. The instance domain name used in this tutorial is server1.example.com, And the IP address is 192.168.0.100. In fact, you have installed it differently. Please modify it accordingly. 1. First install the database MySQL/Mar

Not long ago, Fedora 21 was released. There are three versions, one of which is the Server version. The original Article prompts that the Server version is used, let's take a look at LAMP as short for Linux, Apache, MySQL/MariaDB, and PHP.

The instance domain name used in this tutorial is server1.example.com, And the IP address is 192.168.0.100. In fact, the installation process is different. Please modify it accordingly.

1. First install MySQL/MariaDB 5.

MariaDB installation command:

yum install mariadb mariadb-server

Create auto-start for MariaDB at startup:

systemctl enable mariadb.service

Start the mysql service:

systemctl start mariadb.service

mysql_secure_installation

Set the super root user password and follow the prompts:

[Root @ server1 ~] # Mysql_secure_installation
/Usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: running all parts of this script is 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 will be blank,
So you shoshould just press enter here.

Enter current password for root (enter for none): <-ENTER
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
Root user without the proper authorisation.

Set root password? [Y/n] <-ENTER
New password: <-enter the password
Re-enter new password: <-enter the password again
Password updated successfully!
Reloading privilege tables ..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
To log into MariaDB without having to have a user account created
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You shoshould remove them before moving into
Production environment.

Remove anonymous users? [Y/n] <-ENTER
... Success!

Normally, root shoshould only be allowed to connect from 'localhost'. This
Ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <-ENTER
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
Access. This is also intended only for testing, and shocould be removed
Before moving into a production environment.

Remove test database and access to it? [Y/n] <-ENTER
-Dropping test database...
... Success!
-Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.

Reload privilege tables now? [Y/n] <-ENTER
... Success!

Cleaning up...

All done! If you 've completed all of the above steps, your MariaDB
Installation shoshould now be secure.

Thanks for using MariaDB!
[Root @ server1 ~] #

2. Install Apache2

yum install httpd

Set auto-start with the system:

systemctl enable httpd.service

Start the service:

systemctl start httpd.service

Next, we need to add the Apache service overwrite the firewall command as follows:

firewall-cmd --set-default-zone=public

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

All right, enter the IP address: http: // 192.168.0.100 to check the apache running status:

Fedora system Apache default root directory/var/www/html, configuration file directory/etc/httpd/conf/httpd. conf, other configuration file directories/etc/httpd/conf. d/directory.

3. Install PHP5

Installation command:

yum install php

Restart apache command:

systemctl restart httpd.service

4. Test PHP5 to obtain the installation status of PHP5:

Create a probe file in the root directory:
nano /var/www/html/info.php

Add file content:

 

Then access the probe file: http: // 192.168.0.100/info. php

5. Get PHP5 support for MySQL:
Search for supported plug-ins:
yum search php
Installation:
yum install php-mysqlnd php-mssql php-opcache
Restart the service:
systemctl restart httpd.service

Visit the probe file to see if it is supported.

6. Install phpMyAdmin to manage the database:

yum install phpmyadmin

Now let's set PHPMyAdmin. We changed the Apache configuration so that phpMyAdmin allows connections not only to access localhost addresses ( <目录 usr share phpmyadmin> ):

nano /etc/httpd/conf.d/phpMyAdmin.conf

The configuration is as follows:

 #   AddDefaultCharset UTF-8#   
 
  #     # Apache 2.4#     
  
   #       Require ip 127.0.0.1#       Require ip ::1#     
  #   
 #   
 
  #     # Apache 2.2#     Order Deny,Allow#     Deny from All#     Allow from 127.0.0.1#     Allow from ::1#   
      Require all granted

Restart apache:

systemctl restart httpd.service

After installing OK, access phpmyadmin: http: // 192.168.0.100/phpmyadmin/

Reference link:
  • Apache: http://httpd.apache.org/
  • PHP: http://www.php.net/
  • MySQL: http://www.mysql.com/
  • Fedora: http://fedoraproject.org/
  • PhpMyAdmin: The http://www.phpmyadmin.net/

Recommended reading:

Ubuntu 14.04 configure LAMP + phpMyAdmin PHP (5.5.9) Development Environment http://www.linuxidc.com/Linux/2014-10/107924.htm

Windows 7 hard drive installation Ubuntu 14.10 graphic tutorial http://www.linuxidc.com/Linux/2014-10/108430.htm

Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108402.htm U disk installation

Ubuntu 14.10 official release download http://www.linuxidc.com/Linux/2014-10/108363.htm

How to upgrade Ubuntu 14.04 LTS to Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108381.htm

Ubuntu 14.10 install LAMP service graphic details http://www.linuxidc.com/Linux/2014-12/110082.htm

For more information about Fedora, see Fedora topics page http://www.linuxidc.com/topicnews.aspx? Tid = 5

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-12/110568.htm

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.