nginx+php5.3 cross-site Cross-directory problem setting in VPS

Source: Internet
Author: User
Tags vps


A very important, do the station, safety consciousness must be high.

Even if the site is compromised, the server cannot be breached.

Like my current VPS, installed is the LNMP environment, put a number of stations, including friends of the station, permissions must be set up, each station are isolated from each other, but also with the system isolation.

Because I am loaded is PHP5.3, so can be set in php.ini inside, so actually this is not nginx setting.

At the end of the php.ini, add the following settings to:

The code is as follows Copy Code
[Host=111cn.net]
Open_basedir = "/www/www.xxx.com:/www/tmp/www.xxx.com"
Upload_tmp_dir = "/www/tmp/www.xxx.com"
Session.save_path = "/www/tmp/www.xxx.com"

Where/www/www.111cn.net is the root of the Web site,
/www/tmp/www.xxx.com is the temporary directory of the upload and session of the directory, so that each station session will not be mixed together, that is, each station is independent.

Then, periodically remove the expired session files from the/WWW/TMP in the scheduled task.
Finally, the FTP user, the MySQL user also restricted the good permissions. Only in this way, to ensure the security of the server AH. Of course, there are a lot of things that are not discussed here.


Hint, this article temporarily only supports php5.3 and above version Oh, the other version does not host this function, we can refer to the following method

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.