logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: using symbolic link to deal with virus issue
Author
edwardsmarkf



Joined: 20 Feb 2013
Posts: 25
Location: cottonwood, az

PostPosted: Sun 28 Oct '18 23:05    Post subject: using symbolic link to deal with virus issue Reply with quote

hello -

i would like to temporarily "protect" my index.php file from being changed by malware.

so, i am thinking the best way to do this would be to do the following:

1) move index.php file from the apache www directory to root directory
2) change the ownership to root
3) chmod to 444
4) create a symbolic link to the index.php file in the apache www directory.

unfortunately, i get back an error:
You don't have permission to access / on this server.

is there a way i can protect my index.php file using a method similar to what i just described?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Mon 29 Oct '18 10:40    Post subject: Reply with quote

For that you can use bindfs. The "better-user" can edit the files, while apache can't.

/etc/fstab
Code:

/var/www /var/better-user-www/www/   fuse.bindfs  force-user=better-user,perms=g+rw,create-for-user=better-user,nosuid,nodev


However to your initial question: do you allow in the "Option" FollowSymlinks ?
Back to top


Reply to topic   Topic: using symbolic link to deal with virus issue View previous topic :: View next topic
Post new topic   Forum Index -> Apache