linux基本服务

关闭防火墙

iptables -F
systemctl stop firewalld
systemctl disable 
getenforce

部署apache

1.安装和卸载apache服务器

yum install httpd
yum remove httpd -y

2.启动关闭和重启apache服务器

systemctl start httpd
systemctl stop httpd
systemctl restart httpd

 3.监听apache

netstat -tunlp|grep httpd

4.设置开机自启动和关闭

systemctl enable httpd
systemctl disable httpd

5.查看是否进入开机自启列表

systemctl list-unit-files | grep httpd

部署mysql

1.安装mysql

yum install mariadb-server mariadb  -y

2.启动

systemctl start mariadb

 3.监听mysql

netstat -tunlp  |  grep "mysql"

4.数据库基本操作

#进入mysql
mysql   -uroot    -p

#无密码,enter键进入

#查看数据库
show databases;

#查看user表
use mysql;
select user,password,host from user;

#退出mysql
exit

apache结合php

1.编辑apache配置文件

vim /etc/httpd/conf/httpd.conf

2.在第120行左右添加如下配置

119 DocumentRoot "/var/www/html"
120     TypesConfig /etc/mime.types
121     AddType application/x-httpd-php  .php
122     AddType application/x-httpd-php-source  .phps
123     DirectoryIndex  index.php index.html

3. 编写php脚本检测部署情况

vim /var/www/html/index.php
#输入如下脚本
<meta charset=utf8>
Hello World!
<?php
phpinfo();
?>

 4.重启apache

systemctl restart httpd

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值