欢迎来到CloudService文涵的博客

人生三从境界:昨夜西风凋碧树,独上高楼,望尽天涯路。 衣带渐宽终不悔,为伊消得人憔悴。 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。

Owncloud迁移上云案例

Owncloud迁移上云案例

1、创建云主机并登录

创建好云主机后,绑定浮动IP,再通过securecrt去登录该云主机。
配置好dns和外网连接:

# 修改/etc/resolv.conf
# 其他注释,添加如下内容:
nameserver 8.8.8.8

# 执行配置生效
setenforce 0

ping www.baidu.com

2、配置yum源

rm -rf /etc/yum.repos.d/CentOS-*;
cat > /etc/yum.repos.d/local.repo << EOF
[centos]
name=centos
baseurl=ftp://192.168.16.10/centos7.2
gpgcheck=0
enabled=1
[iaas]
name=iass
baseurl=ftp://192.168.16.10/iaas/iaas-repo
gpgcheck=0
enabled=1
EOF

# 添加阿里yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo  http://mirrors.aliyun.com/repo/Centos-7.repo

# 控制节点——yum缓存清理
yum clean all
yum makecache

3、安装LAMP并启动相应服务

# 1、检查系统更新:
yum update -y
# 2、安装 Apache Web 服务器、MariaDB
yum install -y httpd mariadb-server 
# 3、开启httpd服务
systemctl start httpd
# 4、设置apache http服务开机启动:
systemctl enable httpd
# 5、查看http服务状态:
systemctl status httpd
# 6、启动数据库
 systemctl restart mariadb
# 7、验证:在浏览器中键入云主机实例的IP地址
http://192.168.20.8

4、ownclound软件包上传至ChinaSkill-node-1实例中并解压

# 使用lrzsz或scp或sftp上传文件到服务器/root目录

# 安装unzip工具并解压
yum install -y unzip
unzip owncloud-complete-20200731.zip

# 将网站复制到apache网站目录
cp -r owncloud /var/www/html/

# 修改权限
chown -R apache:apache /var/www/html/owncloud/

5、创建数据库

[root@ip-172-16-44-44 owncloud]# mysqladmin -u root password '12345678'
[root@ip-172-16-44-44 owncloud]# mysql -uroot -p12345678
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.2.10-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database owncloud;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges  on *.* to root@'%' identified by "12345678";
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges  on *.* to root@'localhost' identified by "12345678";
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

6、安装php并重启服务

yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml




yum provides php #自带的只有5.4版本
# 更新系统ca包
yum install -y ca-certificates 
yum install -y php-fpm
# 更新源
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm      #更新源
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum remove php-common -y       #移除系统自带的php-common
yum install -y php72w php72w-opcache php72w-xml php72w-mcrypt php72w-gd php72w-devel php72w-mysql php72w-intl php72w-mbstring #安装依赖包
php -v     #版本变为7.2


systemctl restart httpd && systemctl restart php-fpm;

7、初始化owncloud

使用浏览器访问 http://xxxxxx/owncloud/index.php 初始化owncloud。

posted on 2022-04-27 18:01  Cloudservice  阅读(71)  评论(0编辑  收藏  举报