1. Proftpd creates a hostuser/hostuser account, and all users are mapped to this account.
The htdocs/hosts directory owner is also hostuser
The file attribute uploaded by the user using FTP is hostuser (644 755).
Lock the user to your home directory.
Apache runs with nobody (better for independent apache users), read the script file for hostuser.
For the directories uploads and caches to be written, you must set 777 and cycle through its subdirectories. Two directories prohibit script execution (.htaccess:php_flag engine off). This way, even if a hacker uploads a webshell to these two directories, it cannot be executed.
The owner of the new file in the cache or uploads will be nobody
The cache directory is restricted from external access.
There is a problem here, that is, the files and directories generated by apache 644 and 755. When proftpd is run as hostuser:hostuser, the user cannot delete the contents of the cache or uploads.
Solution:
(1) The chmod file and directory in the PHP program are 666 and 777 respectively
Take adodb as an example, you need to modify the adodb.inc.php file. 1681 lines if (!mkdir($dir,0771)) and adodb-csvlib.inc.php file 287 lines chmod($tmpname,0644); two places
(2) let the user empty in the system Cache and uploads
2. PHP safe_mode, its main function is to check whether the current script and the owner of the file to be read or written or modified are consistent when reading and writing files. If they are inconsistent, they refuse to modify.
However, if the current script owner is hostuser, delete the file in the uploads directory where the owner is nobody. Once safe_mode is turned on, you cannot write it.
So safe_mode is not turned on by default,
The alternative is:
php_admin_value open_basedir /docroot restricts each user to access only their own files. The docroot here is the root directory of the program, not the cache or uploads directory under the program. If it is not the root directory, the PHP program cannot be accessed.
3. (Not guaranteed) All PHP scripts can filter Remote Code Execution and Local File Include attacks. Otherwise, the hacker may still read the password in config.php, or directly read and write the contents of the cache or uploads directory.
The data in the cache directory cannot be stored like a user password.
4. expose_php is set to off, so php will not reveal the version number of PHP in the http file header.
Storage server has been widely used in all walks of life, from daily work, production records, video
In many cases, it is convenient to replace the shift backdoor when the weight is d
using the Web interface When installing network devices, such as network cards, we seem to inevitab
The mail server is a device that is responsible for managing email delivery. E-ma
Set the custom 404 error page in IIS, can not enter the URL address solution
Implement IIS and Apache share port 80
Make web server log files more secure
Just choose the right ones and don't buy expensive ones: how to choose servers according to demand
Solution for the Apache2 service to stop due to a 1 (0x1) service error
Prohibit PHP execution permission for a directory under Apache
IBM blade server to build the ideal dynamic infrastructure
Talking about how small and medium-sized enterprises view server performance design
How much do you know about Windows Server Hardening?
The solution to the 1067 error when the MySql starts under the windows platform and reflection
Your browser sent a request that this server could not understand
Remotely modify the Linux system VPS server Root user password tutorial
Win7 system can not format u disk how to do
Win10 system mail does not display scrolling information how to solve
Win8 Encyclopedia 13: System restore and reinstall the system
Windows 7 system installation Apache_pn service failed
Win7 automatically opened after downloading compressed files
Windows 7: Enable hidden theme for Windows 7
How to install win10 win10 Detailed U disk installation Win10 official version of graphic tutorial
How to upgrade Win10 with Win7?
Safari browser mobile version of the function introduction and use skills
Windows7 system display color calibration settings graphic tutorial