For a website, sometime we used more than a script that separated, yes separated and dont have connection at all each other

for example is a forum, using vbulletin is a blog, using wordpress is ecommerce, using oscommerce is article cms, using joomla

so for security best practice, like if one of the script get hacked or get something wrong,
another script files in another folder,
and another mysql database,
is still secure

can we do that? if so how to do that actually? its looks like simple and basic, but i am still not sure how to do it

if there is tutorial link please let me know too, still cant found it

First, run a checksum on all of the files, except those files that may get changed in the normal course of network access. Daily, re-run the checksums and see if any have changed. If they have, then you have been compromised. One VERY important consideration is to learn how to immunize your site from two common exploits, cross-site scripting (CSS) and SQL injection attacks.