以前搭建的一个博客网站
本地yum源
由于最小化安装的yum网络源经常出问题,所以我们有必要配置一下本地yum源。
- 加载光盘或者光盘镜像
- 挂在光盘
mount /dev/sr0 /mnt
- 如果本地yum源需要长期使用可以把光盘挂载写入etc下的fstab
echo "/dev/sr0 /media iso9660 defaults 0 0" >> /etc/fstab
- 写yum源
vim /etc/yum.repos.d/
[name]
name=rhel-server
baseurl=file:///
enabled=1
gpgcheck=0
yum clean all
yum list
网络yum源
- 你的要先通网络
- 先安装好 wget
yum install -y wget
- 下载yum源
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repoCentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoCentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 重建网路YUM源
yum makecache
- 安装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
测试
- 登陆数据库查看数据是否启动
- echo "<?php phpinfo(); ?>" >/var/www/html/index.php
- 上网站测试php
安装网站
yum install -y lrzsz
上传网站模板
也可以用 scp 上传
设置放火墙
iptables -I INPUT -p tcp --dport 80 -j ACCEPT

浙公网安备 33010602011771号