The cloud application engine service does not allow direct file writing. What workarounds should be taken for online installation of "themes" or generation of "static html files?

Source: Internet
Author: User
Tags vps
In the past, files were directly written in the file system in environments such as vps or independent hosts. Now, in environments such as BAE, SAE, and ACE, prohibit write operations on the APP's own directory files. They provide other data persistence methods (temporary directories, specialized file services, various D... Previously,Files are directly written in the file system in environments such as vps or independent hosts;

Now,In the environment of BAE, SAE, ACE, and other application engines,Prohibit write operations on the APP's own directory filesThey provide other data persistence methods (temporary directories, specialized file services, and various databases ). However,Topic FileAndStatic html fileFor example, it is more appropriate to store it in the originally planned directory.

Q: What are the solutions to this problem?

Reply content:

Previously,Files are directly written in the file system in environments such as vps or independent hosts;

Now,In the environment of BAE, SAE, ACE, and other application engines,Prohibit write operations on the APP's own directory filesThey provide other data persistence methods (temporary directories, specialized file services, and various databases ). However,Topic FileAndStatic html fileFor example, it is more appropriate to store it in the originally planned directory.

Q: What are the solutions to this problem?

First, you can only write data to the file service. There is no way to read data. However, you can give an access url to the files stored in the file system. This url returns your file content. So you can write css and js to the file system and then reference the url to modify the url of the file server.

1. For this, I remember I once saw a case where html files were generated and stored in the database and then called. This idea is similar.

2. SAE is operated by SVN. You can also submit local files. I did this myself.

3. You can also use reverse proxy to generate html files.

5. if you want to build similar programs such as static blogs, you 'd better find a domestic static storage service (such as qiniu and upyun) and install the program, qiniu can generate html static files, that is to say, it supports static blogs and other programs (no data). I have not tested upyun.

6. If it is a program such as wordpress, it is really troublesome to modify theme or something! We recommend that you set up the local environment, and synchronize the files above the SAE. After the local modification test is complete, submit it using SVN.

I think this is a very good improvement. For example, there was a case in the previous two days: how to clean up the php script to insert a trojan?

This problem is still a problem of design ideas. For example, the topic file is a dynamic storage. You can write the initial topic file in the webpage deployment/installation program, and then you can manually add it.

Static files can be directly stored in application storage. If the html cache file is generated, it can be implemented through reverse proxy.

Svn or git update, you will find it better when you get used to it.

If no, you will ask, "Why does the cloud application engine service allow direct file write operations and how can it cope with vulnerabilities caused by malicious scripts ?』

I don't think this method is good, but I think it is better to store this kind of thing into the cache. What do you think?

Very annoying. SAE and ACE are both relatively backward application engines. Isn't BAE adopting lightweight container technology? There should be no such restrictions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.