Previously,In the context of VPS or standalone host, it is written directly in the file system;
now, in the environment of the application engine such as Bae, SAE, Ace and so on, it is forbidden to write to the app's own directory files , they provide other ways of data persistence (temporary directory, special file service, various db). However, for " 主题文件
and" 静态html文件
, it is more appropriate to save in the originally planned directory.
Q: What are the other ways of coping with this situation?
Reply content:
Previously, in the VPS or standalone host environment, are directly in the file system to write files;
now, in the environment of the application engine such as Bae, SAE, Ace and so on, it is forbidden to write to the app's own directory files , they provide other ways of data persistence (temporary directory, special file service, various db). However, for " 主题文件
and" 静态html文件
, it is more appropriate to save in the originally planned directory.
Q: What are the other ways of coping with this situation?
The first thing to say about writing, you can only write to the file service, this is no way, read can only be so. But you can give a URL to the file stored in the file system, and this URL returns the content of your file. So you can css, JS write to the file system, and then reference the URL to modify the file server URL.
1. About this, I remember I once saw a case where an HTML file was generated and stored in the database and then called. Almost the idea.
2.SAE is working with SVN, and you can submit it locally, and I do it personally.
3. You can also consider the creation of HTML files, with the reverse proxy implementation.
5. If you want to build a static blog and other similar programs, it is better to find a domestic static storage services (such as: seven Cattle, Upyun), where to install the program, seven cows can generate HTML static files, that is, support static blog and other programs (no data), Upyun I have not tested
6. If it is WordPress and other programs, the theme of what changes, indeed trouble! Recommended local environment, and then the SAE above the file synchronization, the local modification after testing, and then use SVN submit
I think this is a very good progress, such as the previous two days there is a case: PHP script inserted Trojan, how to clean?
The problem of the main question or design ideas, such as theme files, is dynamic storage, you can write the initial theme files in the deployment/Setup program of the Web page, and then the user can manually add.
Static files can be placed directly into the application store, if the generated HTML cache file, can be implemented by reverse proxy.
SVN or git update, using the habit you will find, better.
Without it, you ask, "Why does the cloud Application engine service allow direct write file operations, and how can I cope with a vulnerability caused by a malicious script?" 』
I don't think this way is good, I think it's better to put this stuff in the cache, don't you think?
Very annoying thing. SAE, Ace is a relatively backward application engine, BAE is not the use of lightweight container technology? There should be no such restrictions.