LAMP deployment and access control authority

apache deployment

1. Check whether you have installed the httpd
command rpm -qa |grep httpd, (rpm -e --nodeps httpd uninstall)
2. No installation, use yum to install
yum install httpd
3. Start the service
service httpd start
4. Check the port number information
ss -antpl | grep 80
Insert picture description here
5. The establishment of the home page
Switch directory: cd /var/www/html to
establish the index.html file
Turn off the firewall and setlinux
6. Open the web page to access IP

Analysis of the main configuration file:
Insert picture description here

Turning off as follows will turn off sharing:
Insert picture description here

Access control settings

Open the configuration file:
Insert picture description here
modify:
Insert picture description here
restart service
service httpd restart

Access by authentication method:
Insert picture description here

Insert picture description here

mysql deployment

Download: https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz
Install MySQL: mysql: wget https://dev.mysql .com/get/mysql57-community-release-el7-11.noarch.rpm
Install MySQL source:
yum -y localinstall mysql57-community-release-el7-11.noarch.rpm
Install mysql online:
yum -y install mysql-community -server to
start mysql service:
systemctl start mysqld
set to boot
systemctl enable mysqld
systemctl daemon-reload
set root password For
Insert picture description here
details, please see: https://blog.csdn.net/EB_NUM/article/details/105425622
Another offline installation: https ://www.cnblogs.com/ruanjianlaowang/p/11182435.html

Install PHP

yum install php
requires a plug-in to connect to the database, install php-mysql:
yum install php-mysql
install php-mbsring
yum install php-mbsring
configure PHP configuration file
Insert picture description here
Insert picture description here
Create index.php under /var/www/html,

Guess you like

Origin blog.csdn.net/weixin_42478365/article/details/113741910