以前搭建的一个博客网站

本地yum源

由于最小化安装的yum网络源经常出问题,所以我们有必要配置一下本地yum源。

  1. 加载光盘或者光盘镜像
  2. 挂在光盘

mount /dev/sr0 /mnt

  1. 如果本地yum源需要长期使用可以把光盘挂载写入etc下的fstab

echo "/dev/sr0 /media iso9660 defaults 0 0" >> /etc/fstab

  1. 写yum源

vim /etc/yum.repos.d/

[name]
name=rhel-server
baseurl=file:///
enabled=1
gpgcheck=0

yum clean all
yum list

网络yum源

  1. 你的要先通网络
  2. 先安装好 wget

yum install -y wget

  1. 下载yum源

CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

  1. 重建网路YUM源

yum makecache

  1. 安装epel源

yum install epel-release –y

yum安装整个服务

yum安装

yum install -y httpd mysql mysql-server php php-mysql

LAMP启动

service httpd restart
chkconfig httpd on
service mysqld start
chkconfig mysqld on

初始化数据库

mysql_secure_installation

测试

  1. 登陆数据库查看数据是否启动
  2. echo "<?php phpinfo(); ?>" >/var/www/html/index.php
  3. 上网站测试php

安装网站

yum install -y lrzsz

上传网站模板

也可以用 scp 上传

设置放火墙

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

posted @ 2018-02-20 16:03  Y.E  阅读(84)  评论(0)    收藏  举报