Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos7 yum install LAMP

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Centos7 yum install LAMP

Operating environment:

The virtual machine must be able to access the Internet, and you can use the ping command to check whether it can be accessed by ping Baidu. The successful result is shown below:

Yum install wget-y (wget is a free tool for automatically downloading files from the Internet)

Yum install httpd (install apache service)

Systemctl start httpd (start httpd)

Systemctl enable httpd (set httpd to boot)

Netstart-anpt | grep httpd (check whether port 80 is started, as shown in the following figure)

Httpd-v (view apache version)

test

Systemctl stop firewalld, turn off the firewall

Setenforce 0 turns off selinux Firewall

Enter an ip address or URL in the browser as shown below

The above are all operations for yum to install apache.

II.

Deploy mysql (mariadb)

Wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm (obtained rpm software package, as shown below)

Rpm-ivh mysql-community-release-el7-5.noarch.rpm (install rpm package)

Yum install-y mysql-community-server (install mysql)

Systemctl start mysql-start mysql,mysql to work on port 3306

Systemctl enable mysql-set to boot automatically

The mysql command enters the database. If you set the password for mysql, the format must be: myql-u username-p password

Enter the following command into the database

Set password for 'root'@'localhost' = password (' 123');-- set the root password to 123

Grant all privileges on. To root@'%'identified by '123456 accounts;-- set to allow remote connections with a root account and set its password to 123456

Flush privileges;-the modification of the configuration takes effect immediately

Quit-exit

Mysql-V-check the version of mysql

The above is the mysql installation operation

3.

Deploy PHP

Yum install-y php-install php

Yum install-y\-the installation component is php that supports mysql

Php-mysql\

Php-gd\

Libjpeg*\

Php-ldap\

Php-odbc\

Php-pear\

Php-xml\

Php-xmlrpc\

Php-mbstring\

Php-bcmath\

Php-mhash

Php-- version-- View the php version

Vi / etc/httpd/conf/httpd.conf-apa configuration file

ServerName www.aa.com-Web site

DirectoryIndex index.html index.php-make apache support php

Vi / etc/php.ini

Date.timezone = PRC set date time zone = × × ×

Cd / var/www/html-- cd to the root of the web page

Vi index.php-create a web page in php format and add the following

: wq-- Save exit

Test:

Enter 192.168.80.100 in the browser-- according to the actual situation, the result of the successful test is as follows

Vi / var/www/html/index.php-- re-edit the page, delete the original content, and add the following

: wq-- Save exit

The successful results of the test are as shown below:

Above mysql and php configuration and testing

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report