The website server is always infected with Trojans, and the website header is injected with a large amount of js Code. After a long time, the solution is finally solved. The root cause of the problem is that when configuring the lampp server, 777 permissions are granted to the root directory of the website for simplicity and convenience, and hackers are allowed to access the server. The solution is to properly Configure permissions.The specific method is as follows:
1. reinstall the linux system: Select 32bit ubunt in the background
2. Download the xampp server: wget url
3. Unzip xampp: tar xvfz xampp-linux-1.7.3a.tar.gz-C/opt
Note: Use the tar-zcvf *** .tar.gz folder to compress the file.
4. start the server:/opt/lampp start
5. Set the security Password:/opt/lampp security
6. Copy the backup file from another server: scp root @ ip: File Location/file name (the file has been backed up)
7. Restore etc/extra/httpd-vhosts.conf,
8. Modify extra/httpd. conf and add the last line to the httpd-vhosts.conf
9. Modify the size limit of the data file imported from the database: extra/php. ini
10. Create a user: adduser ×××
11. Create a user group: addgroup ×××
12. Add the Working Group usermod-G groupname username to existing users.
13. Change the user chown-R user file of the website under the htdocs folder and log on to FTP using the user name and password.
14. Change the permission to upload the image directory to the 777: chmod-R 777 image folder.