Lane-CentOS7-install LAMP as Web Service

Source: Internet
Author: User

Lane-CentOS7-install LAMP as Web Service

1.

# Yum install php

(The dependency package also drops httpd)


# Systemctl start httpd. service

# Firewall-cmd -- add-service = http

(The firewall unblocks http Services)

# Firewall-cmd -- permanent -- add-service = http

(Firewall unblocks http Services and writes the configuration file)

(You can view/etc/firewalld/zones/public. xml and/usr/lib/firewalld/services/http. xml)

(Php and httpd have been installed)

2.

# Yum list mysql

(No package... embarrassing)

(Go to http://dev.mysql.com/downloads/repo/yum)

# Yum install wget

# Wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

# Rpm-ivh mysql-community-release-el7-5.noarch.rpm

# Yum install mysql-server

# Systemctl start mysqld. service

# Mysql_secure_installation

(Set the password according to the prompt, and enter y for all other options. In special cases, you can determine the password)

# Mysql-u root-p

(Password test successful)

Mysql> grant all privileges on *. * to "lane '@' % 'identified by '000000' with grant option;

(Username lane password 123456 allows all ip addresses to log on *. * That is, all permissions. This is very dangerous. It doesn't matter if I use a virtual machine for testing. In the actual production environment, do not execute such commands)

Mysql> flush privileges;

Mysql> quit;

# Firewall-cmd -- add-service = mysql

# Firewall-cmd -- permanent -- add-service = mysql

# Yum install php-mysql

(Installation completed)

# Systemctl restart httpd. service

# Systemctl restart mysqld. service

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.