Restricting the site directory in nginx+php prevents cross-site configuration scenario logging (using Open_basedir)-------------------
Method 1) In the Nginx configuration file, add:
1 |
fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/:/proc/" ; |
Usually nginx site configuration file with include fastcgi.conf, so, add this line in the fastcgi.conf is OK.
If a site needs to set up additional directories separately, write the above code in the include Fastcgi.conf, and the line below will be OK, overwriting the settings in the fastcgi.conf.
This mode of Setup requires the restart of Nginx to take effect.
Method 2) Add in the php.ini
1234 |
[HOST=www.wangshibo.com] open_basedir= /home/www/www .wangshibo.com: /tmp/ : /proc/ [PATH= /home/www/www .wangshibo.com] open_basedir= /home/www/www .wangshibo.com: /tmp/ : /proc/ |
This mode of Setup requires a restart of php-fpm after it takes effect.
Method 3) Create the. user.ini file in the root directory of the Web site and write the following information in the file:
1 |
open_basedir= /home/www/www .wangshibo.com: /tmp/ : /proc/ |
There is no need to restart the Nginx or PHP-FPM service in this way. For security reasons, you should cancel the Write permission for the. user.ini file.
The following functions are recommended in php.ini:
1 |
disable_functions = pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_w |
Gmt
|
Detect languageAfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDutch中文版EsperantoEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanLaoLatinLatvianLithuanianMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPersianPolishPortuguesePunjabiRomanianRussianSerbianSesothoSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshYiddishYorubaZulu |
|
AfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CroatianCzechDanishDutch中文版EsperantoEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanLaoLatinLatvianLithuanianMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPersianPolishPortuguesePunjabiRomanianRussianSerbianSesothoSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshYiddishYorubaZulu |
|
|
|
|
|
Text-to-Speech function is limited to characters
|
|
Options:History:Feedback:Donate |
Close |
Restricting site directories in nginx+php to prevent cross-site configuration scenario Logging