Lamp quick environment setup in centos7

Source: Internet
Author: User

Lamp quick environment setup in centos7
1. configure the firewall

CentOS 7.0 uses firewall as the firewall by default.

1. Disable firewall:

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Systemctl stop firewalld. service # stop firewall
Systemctl disable firewalld. service # disable firewall startup


2. Disable SELINUX

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Vi/etc/selinux/config
# SELINUX = enforcing # comment out
SELINUX = disabled # Add
: Wq! # Save and exit
Setenforce 0 # Make the configuration take effect immediately

3. install apache

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Yum install httpd # Enter Y as prompted to install httpd.
Systemctl start httpd. service # start apache
Systemctl stop httpd. service # stop apache
Systemctl restart httpd. service # restart apache
Systemctl enable httpd. service # Set apache startup

4. Install mariadb (mysql)

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Yum install mariadb-server # ask if you want to install mariadb. Enter Y to install mariadb automatically until installation is complete.
Systemctl start mariadb. service # start MariaDB
Systemctl stop mariadb. service # stop MariaDB
Systemctl restart mariadb. service # restart MariaDB
Systemctl enable mariadb. service # Set startup

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Modify the mysql password: set password for 'root' @ 'localhost' = password ('root ');

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Mysql authorized remote connection (navicat, etc.): grant all on *. * to root identified by 'root ';


5. install PHP and components so that PHP supports MariaDB

[Python] view plain copy
View the CODE piece derived from my CODE piece on CODE

Yum install php-mysql php-gd libjpeg * php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
# Select the preceding installation package for installation. Enter Y and press enter as prompted.
Systemctl restart mariadb. service # restart MariaDB
Systemctl restart httpd. service # restart apache


Test

Cd/var/www/html

Vi index. php # enter the following content

<? Php

Phpinfo ();

?>

: Wq! # Save and exit

Start command line systemctl set-default multi-user.target
Enter the Server IP address in the browser of the client. The configuration information shown in is displayed!
Menuentry "Windows 7 (loader) (on/dev/sda1 )"{
Insmod ntfs
Set root = (hd0, 1)
Chainloader + 1
}

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.