运维小白之LAMP搭建

略有瑕疵版

建YUM源
mkdir /dvd
mount /dev/cdrom /dvd
cd /etc/yum.repos.d/
vi dvd.repo
[dvd]
name=dvd
baseurl=file:///dvd
gpgcheck=0
yum clean all
yum repolist
安装
yum install httpd httpd-devel mariadb-server mariadb-devel php php-mysql php-devel
重启
systemctl restart {httpd,mariadb}
systemctl status httpd
systemctl status mariadb
关闭防火墙
iptables -F
iptables -X
iptables -Z
iptables –L
service iptables save
关闭setenforce
setenforce 0
修改配置文件
cd /etc/httpd/conf.d
vi /etc/httpd/conf/httpd.conf
DocumentRoot “/var/www/html”
。。。。。。。
把下面这一行改成下面这样
<Directory “/var/www/html”>
AllowOverride None
# Allow open access:
Require all granted

解压zip安装包(在CSDN搜索,有资源)
cd /root
ls
mv Desktop/Discuz_X3.1_SC_UTF8.zip /root
mv /var/www/html/index.php /mnt/
ls
unzip Discuz_X3.1_SC_UTF8.zip -d /var/www/html/
cd /var/www/html/
ls
cd upload/
cp -rf * /var/www/html/
cd …
ls
设置数据库管理员账户密码
mysqladmin -u root password 000000
mysql -uroot –p
搭建数据库
show databases;
create database discuz;
grant all on discuz.* to discuz@‘localhost’ identified by “000000”;
use discuz;
修改属主属组
chown -R apache.apache /var/www/html/
修改文件权限信息
chmod –Rf 777 /var/www/html
重启服务
systemctl restart httpd
systemctl restart mariadb
systemctl enable httpd
systemctl enable mariadb

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值