fixyourserver.com

A lot of stuff and things…

How To: Make your site work with SuPHP

Hello my treacherous friends,
I recently saw a person struggling with a SuPHP installation. Most of todays database driven web software require some open permissions to allow administrators to ‘write’ to there files. Some items will require 777 permissions on directories or 666 permissions on files allowing vandals to destroy your site and it’s reputation. Well SuPHP will help to resolve some of this. It will make accessing user, usually nobody, set to the username, in my examples will be ‘joeblow’. Whether I’m explaining it properly or not it makes sense to me.
Onward! This entire tutorial is going to assume your running cPanel as paths should show. First off, direct yourself into this users public_html directory and run something similar to the following:

find /home/joeblow/public_html/ -type d -exec chmod 755 {} \;
find /home/joeblow/public_html/ -type f -exec chmod 644 {} \;
chown joeblow.joeblow /home/joeblow/public_html/* -R

The above will keep things rocking.
So on to a hypothetical, and very common, situation. You use php_flag || php_value in your .htaccess file, well cut them out, and paste them back into a notepad somewhere. save the .htaccess without.
Now,

cp -pr /usr/local/lib/php.ini /home/joeblow/public_html/  

Now joeblow has his very own php.ini, woaaaaah! 🙂 but wait, what did I just tell you? odds are you’re running this all as root no?

chown joeblow.joeblow /home/joeblow/public_html/php.ini

Now open up the trusty notepad compare the values to those in joeblow’s php.ini. Change and done.
or if you want to be a really cool dude, alter your script to do it for you with something like ini_set(“register_globals”, “On”);

Be cool!

Next Post

Previous Post

Leave a Reply

© 2017 fixyourserver.com

Theme by Anders Norén