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,搭建一个在线教育视频课程分享网站。
目录
相关文章
|
5月前
|
SQL DataWorks 数据可视化
DataWorks操作报错合集之测试OSS数据源的连通性时,出现503 Service Temporarily Unavailable的错误,是什么导致的
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
|
5月前
|
关系型数据库 分布式数据库 数据库
PolarDB产品使用问题之如何将冷存到OSS(Object Storage Service)的数据恢复
PolarDB产品使用合集涵盖了从创建与管理、数据管理、性能优化与诊断、安全与合规到生态与集成、运维与支持等全方位的功能和服务,旨在帮助企业轻松构建高可用、高性能且易于管理的数据库环境,满足不同业务场景的需求。用户可以通过阿里云控制台、API、SDK等方式便捷地使用这些功能,实现数据库的高效运维与持续优化。
|
5月前
|
开发者 Python
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
151 0
|
存储 前端开发 JavaScript
|
存储 开发工具 对象存储
OSS(Object Storage Service)
OSS(Object Storage Service)是阿里云提供的对象存储服务,是一种海量、安全、低成本、高可靠的云存储服务。OSS 可以存储和管理各种类型的非结构化数据,例如图片、音频、视频、文档等。
523 0
|
存储 数据采集 运维
Alibaba Cloud Lens for OSS最佳实践
——其冀 阿里云智能产品专家
Alibaba Cloud Lens for 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.
5259 0
How to Automate Backups with Alibaba Cloud Object Storage Service
|
存储 Java 对象存储
ApiBoot - ApiBoot Alibaba Oss 使用文档
`ApiBoot`添加快速集成`Aliyun`的对象存储服务`Oss`,提供常用的文件操作方法,当然也提供自定义扩展,以致于满足绝大数业务场景,并且通过扩展可以实现上传文件进度条、下载文件进度条、存储空间操作、静态网站托管、访问日志、防盗链、分片上传、追加上传、断点续传等等。
|
对象存储 CDN
How to Use Object Storage Service (OSS) More Economically
What is the best configuration of OSS for you to minimize costs?
1915 0
|
3天前
|
JSON Java Apache
Java基础-常用API-Object类
继承是面向对象编程的重要特性,允许从已有类派生新类。Java采用单继承机制,默认所有类继承自Object类。Object类提供了多个常用方法,如`clone()`用于复制对象,`equals()`判断对象是否相等,`hashCode()`计算哈希码,`toString()`返回对象的字符串表示,`wait()`、`notify()`和`notifyAll()`用于线程同步,`finalize()`在对象被垃圾回收时调用。掌握这些方法有助于更好地理解和使用Java中的对象行为。

热门文章

最新文章