Linux安装

1、查看是否安装过Apache

 

rpm -qa | grep httpd

2、有就卸载httpd。

 

yum remove -y "httpd*"

 

3、重新安装httpd。

 

yum install -y httpd

 

4、查看启动状态。

 

systemctl status httpd

 

5、启动httpd。

 

systemctl start httpd

 

6、添加开机启动。

 

systemctl enable httpd

 

7、设置防火墙开放tcp80端口。

 

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --reload

firewall-cmd --query-port=80/tcp

8、使用浏览器访问http://192.168.1.150/,显示如下界面,说明安装的Apache HTTP服务正常运行。

 

 

 

 

 

9、默认网站主页位于默认目录/var/www/html/中。若要发布自己的网站内容,替换index.html主页内容即可。例:主页内写入内容 “This is a apache test.” ,使用浏览器访问http://192.168.1.150,则显示如下界面内容。

 

 

 

 

 

touch    /var/www/html/index.html

echo     "This is a apache test."     >     /var/www/html/index.html

二、安装mysql数据库

 

1、查看是否安装过mariadb。

 

rpm -qa | grep mariadb

 

2、有就卸载mariadb。

 

yum remove -y "mariadb*"

 

3、重新安装mariadb-server。

 

yum install -y mariadb-server

 

4、启动mariadb。

 

systemctl start mariadb.service

 

5、查看启动状态。

 

systemctl status mariadb

 

6、添加开机启动。

 

systemctl  enable  mariadb

 

7、设置mysql数据库root账号密码。

 

mysqladmin -uroot  password  'yourpasswo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值