一、安装ApacheQ
1、查看是否安装过Apache。rpm -qa | grepQ httpd
2、如果有就卸载httpd
yumQ remove -y "httpd*"
3、重新安装httpd。yum install -y httpd4、查看启动状态。
systemctl status httpd5、 启动httpd。
systemctl start httpd
6、添加开机启动。
systemctl enable httpd
7、设置防火墙开放tcp80端0。
firewall-cmd --zone=public -add-port=80/tcp -permanent
firewall-cmd -reload
firewall-cmd -query-port=80/tcp
8、使用浏览器访问ttp://192.168.43.6/,显示如下界面,说明安装的Apache HTTP服务正常运行。
9、默认网站主页位于默认目
录/var/www/htm/中。若要发布自己的网站内容,替换index.html主页内容即可。例:主页内写入内容“This is a apache test.",使用浏览器访问http://192.168.43.6,则显示如下界面内容。
touch /var/www/html/index.htmlecho "This is a apache test." >/var/www/html/index.html
二、 安装mysq|数据库
1、查看是否安装过mariadb。rpm -qa | grep mariadb
2、 有就卸载mariadb。
yum remove -y "mariadb*"
3、重新安装mariadb-server。yum inst