1.安装apache
yum install httpd
2.修改配置文件
vi /etc/httpd/conf/httpd.conf
将#ServerName www.example.com:80前面的#去掉
修改为ServerName localhost:80
3.添加端口,刷新配置,并查看确认
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload
firewall-cmd --permanent --zone=public --list-ports
4.开启apache服务
systemctl start httpd.service
由于mysql从CentOS7开始收费了,因此只能用它的分支mariadb
1.安装
yum -y install mariadb-server
2.开启
systemctl start mariadb
3.确认
systemctl status mariadb
4.开启3306端口
参考
https://blog.csdn.net/yesterday_lover/article/details/117440973
5.本地测试
mysql -u root -p
6.远程测试:
mysql -u root -h 192.168.1.155 -p
1.安装
yum install php php-devel
2.测试
cd /var/www/html/
touch index.php && vi index.php
复制粘贴如下:
<?php phpinfo(); ?>
保存并退出:wq
3.打开地址访问