How to Apply Alibaba Cloud Object Storage Service Resources to Websites

本文涉及的产品
对象存储 OSS,20GB 3个月
对象存储 OSS,恶意文件检测 1000次 1年
对象存储 OSS,内容安全 1000次 1年
简介: This article discusses the various applications of OSS and addresses some of the most common issues when applying OSS to websites.

Redis_and_Memcached

Alibaba Cloud Object Storage Service (OSS) can be used for all kinds of static resources. In this article, we will discuss how to apply OSS resources to a website and examine why a website may fail to be accessed after OSS has been applied.

Applying OSS Resources to a Website

A user can store static resources, such as images, documents, and multimedia files, on OSS and bind a custom domain name to an OSS bucket.

Bind custom domain name to OSS: OSS domain name binding

For example, if the user's website is www.a.com and it contains a static resource 1.jpg , the user can store 1.jpg on the OSS bucket and bind the domain name oss.a.com to the bucket. The previous URL link for www.a.com was www.a.com/1.jpg, but now it can be changed to oss.a.com/1.jpg. If everything is done correctly, the OSS resource will be available on the website.

How to Migrate Static Resources to OSS

There are a few options to migrate static resources to OSS.

1) Iterate over each static resource you wish to migrate and call the putObject method in the SDK to upload them to the OSS: SDK object upload

Note: This requires prior knowledge in programming

2) Call ossimport to migrate. This requires a Java development environment and ossimport tool. The tool itself is quite simple. See OSSimport data migration tool

3) Search for third-party client tools in the Alibaba Cloud Marketplace to migrate your data

How to Obtain the URL Link of an Object

After successfully uploading your resources, if the bucket is Public-Read, the user can access the object through URL like so: bucketname.oss-cn-hangzhou.aliyuncs.com/objectname;

You can also obtain the URL link of the object through OSS Console. Go to the specific bucket, find your object, select Object Management, and click Obtain Address.

Another option is to obtain the URL through the SDK.

Obtain a signed URL: Obtain signed URL through the SDK

Obtain an unsigned URL: Obtain unsigned URL through the SDK

Sending Newly Uploaded Resources on the Website to OSS

1) This website integrates an OSS WEB direct transfer demo for directly transferring resources from website to OSS, see direct resource transfer from website to OSS

2) This website integrates OSS Javascript SDK for directly transferring resources from website to OSS, see apply OSS in Javascript browser

3) Use the OSSFTP tool to apply bucket resources, see OSSFTPserver deployment

First invoke a server to deploy the OSSFTP server, and the FileZilla client to connect to the FTP server. After successfully testing the link, configure FTP for the website, then connect to the OSSFTP server and OSS

For Discuz configuration, see Discuz configuration

For PHPwind configuration, see PHPwind configuration

For WordPress configuration, see WordPress configuration

Troubleshooting Website Access Issues after Applying OSS

Check if the website domain name is bound to the bucket on your console. Go to Console > OSS > Specific_Bucket_Name > Domain Name Management.

Cause: An application's domain name originally had either an A record or CNAME record. After binding the bucket, as the domain name CNAME now redirects to the bucket's external address, it no longer points to the original service, which leads to failed requests to the original website.

Solution: Unbind the website domain name from the bucket and use a sub-domain name to bind to the bucket (make sure that the sub-domain name is not open to external services), for example oss.a.com or any other sub domain name.

Return the A record /CNAME record of the website domain name from the domain name server to the original website, and bind oss.a.com to the external address of the bucket.

相关实践学习
借助OSS搭建在线教育视频课程分享网站
本教程介绍如何基于云服务器ECS和对象存储OSS,搭建一个在线教育视频课程分享网站。
目录
相关文章
|
8月前
|
存储 前端开发 JavaScript
|
10月前
|
存储 安全 Java
OSS(Object Storage Service)
OSS(Object Storage Service)是阿里云提供的对象存储服务,是一种海量、安全、低成本、高可靠的云存储服务。OSS 可以存储和管理各种类型的非结构化数据,例如图片、音频、视频、文档等。
385 0
|
存储 数据采集 运维
Alibaba Cloud Lens for OSS最佳实践
——其冀 阿里云智能产品专家
Alibaba Cloud Lens for OSS最佳实践
|
数据库
SAP Cloud for Customer UI Designer里如何消费Object Value Selector(OVS)
SAP Cloud for Customer UI Designer里如何消费Object Value Selector(OVS)
SAP Cloud for Customer UI Designer里如何消费Object Value Selector(OVS)
使用SAP Cloud Application Studio实现OVS(Object Value Selector)
使用SAP Cloud Application Studio实现OVS(Object Value Selector)
使用SAP Cloud Application Studio实现OVS(Object Value Selector)
|
存储 Java 对象存储
ApiBoot - ApiBoot Alibaba Oss 使用文档
`ApiBoot`添加快速集成`Aliyun`的对象存储服务`Oss`,提供常用的文件操作方法,当然也提供自定义扩展,以致于满足绝大数业务场景,并且通过扩展可以实现上传文件进度条、下载文件进度条、存储空间操作、静态网站托管、访问日志、防盗链、分片上传、追加上传、断点续传等等。
|
对象存储
How to Automate Backups with Alibaba Cloud Object Storage Service
In this tutorial, we will explore how we can automatically upload backups to Alibaba Cloud OSS with Minio Client and cronjob.
5223 0
How to Automate Backups with Alibaba Cloud Object Storage Service
|
Oracle 安全 关系型数据库
Alibaba Cloud Object Storage vs. IBM Cloud and Oracle Cloud Equivalent
Most public cloud providers provide object storage for general-purpose data storage.
2148 0
|
29天前
|
存储 关系型数据库 分布式数据库
PolarDB常见问题之PolarDB冷存数据到OSS之后恢复失败如何解决
PolarDB是阿里云推出的下一代关系型数据库,具有高性能、高可用性和弹性伸缩能力,适用于大规模数据处理场景。本汇总囊括了PolarDB使用中用户可能遭遇的一系列常见问题及解答,旨在为数据库管理员和开发者提供全面的问题指导,确保数据库平稳运行和优化使用体验。
|
4月前
|
存储 SQL 分布式计算
数据计算MaxCompute读取外部表(数据在oss gz压缩)速度非常慢,有什么方法可以提升效率么?
数据计算MaxCompute读取外部表(数据在oss gz压缩)速度非常慢,有什么方法可以提升效率么?
48 1