|
#1
|
|||
|
|||
|
Dear Customers,
We'd like to announce that we have installed PHPSUEXEC on a few of our existing servers. A few changes might be needed on your website's configuration files (.htaccess) (do not panic ).All the php_flags in your .htaccess will have to be moved to php.ini, which you will have to create in your public_html directory. Example: .htaccess » php_flag register_globals on php.ini » register_globals=on The file php.ini will handle all the extra settings you need to set in php. So, basically you will have to move every command on .htaccess that starts with php_flag. Differences between phpsuexec and "regular php": When using the common PHP installation on a webserver, php runs as the user nobody and it doesn't require the execute flag to be enabled. The problem on this is that if mod_openbasedir is not installed (we have this at HostGator), every user will be able to read your php files because everyone is virtually sharing the same username (nobody). As most of you already know, PHP Files are not meant to be read, but parsed, and that is where the problem resides. PHP Files have to be parsed, otherwise everyone who is able to read your php file will see settings that you would probably want to keep private, such as your MySQL username and password. PHPSUEXEC fixes all this because it requires php to be run as the file owner's username. (for example: andre) This is not everything it fixes though. PHPSUEXEC is also here to fix file ownership problems. This has been a common issue on a few Content Management Systems such as Joomla and also on the popular blog software: WordPress. It also adds security to your files as you can use permissions such as 600 or 700 in your files and your visitors will still be able to view them (parsed) in their browsers. PHPSUEXEC will also refuse to serve any pages that are at security risk, for example with 777 as permissions. (will generate an Internal Server Error) Troubleshooting Internal Server Errors (Error 500): Everytime an internal server error occurs, it will be added to your Error Log in cPanel. (cPanel »» Error Log). This will usually give you a clue on where the error resides. In most cases it will be either a permission error on a bad command in your .htaccess file (remember that all php values have to go to your php.ini file). Directories that need to be written onto will no longer require 777 as permissions and phpsuexec will refuse to write or read on directories exposed with such permissions. You will have to chmod them to 755 always. To simplify it, just remember that you should never have a file or folder with world-writeable permissions, because you no longer have to. MIMETypes: If you added a Mimetype to the system in order to run html files as php scripts (AddType as .htaccess command), you will have to remove it and add an ApacheHandler instead. This is easy to do though. Just log into your control panel, then click on Apache Handlers and add the following: Extension: html (or htm) Handler: application/x-httpd-php QuickStart for impatient users :Technically, PHPSUEXEC will make sure your scripts and directories abide by the following security rules:
To protect your php.ini you should set its permissions to 600. Additionally you can add the following line to your .htaccess file: Code:
<Files *.ini> Order deny,allow Deny from All </Files> WordPress Bloggers: If you encounter any problems with your .htaccess file (mod_rewrite instructions), you can fix this by downloading the following: http://boren.nu/archives/2005/03/07/...ewrite-plugin/ We have updated WordPress in Fantastico so it is configured for phpsuexec from the start. So if you are desperate you can always reinstall WordPress from Fantastico. (Just remember to download a database backup first!). After it's installed, just change your MySQL configuration settings in WordPress. Drupal and other Content Management Systems: You might experience a few errors, such as "Call to undefined function: user_access()". Add the following code to php.ini to fix it: Code:
session.save_handler = files session.cache_limiter = nocache I am subscribed to this thread, so if you need any help on this you can reply to it (it is preferrable to ask for help here so other users can also find the information they are looking for, if they have the same problem). Thanks! |
|
#2
|
||||
|
||||
|
So I have to do this to my main reseller account AND my clients'?
__________________
Have a great day, Evan |
|
#3
|
||||
|
||||
|
I hope you dont mean dedicated to? I do not have time to make those kind of changes.....
|
|
#4
|
||||
|
||||
|
can we know which servers are alredy changed and the schedule for our server?
Vt
__________________
Vtrain is Linux User #237333 on http://counter.li.org/ "Don't meddle in the affairs of sysadmins, for they are subtle and quick to anger." |
|
#5
|
|||
|
|||
|
Hello there,
Quote:
![]() The php.ini file is not necessary unless you have been using extra php configurations in .htaccess as I described above to prevent errors. Sites that do not use any special .htaccess or php configurations should work with no problems at all. You can just pass this information to your clients so they know what to do, unless you provide coding support as well. (in that case you will have to do it )Quote:
PHPSuExec is recommended, though you are not forced to change at all, that's just my advice. Quote:
|
|
#6
|
||||
|
||||
|
Thank you for the quick reply Andre!
__________________
Have a great day, Evan |
|
#7
|
|||
|
|||
|
Quote:
![]() I do not think your server already has it installed though. A good way of checking this out is to place a phpinfo file on your website's public_html directory. Simply create a new file with the name phpinfo.php and add the following code to it: Code:
<? phpinfo(); ?> You should look for Server API on it (4th row). If it says CGI it means you are using phpsuexec. If it says APACHE, then it means you are not using it yet. |
|
#8
|
|||
|
|||
|
How will we know when our server is changed over? Is there a web page with scheduled/completed dates for each server? This would be very helpful for this upgrade as well as others. It doesn't have to be pretty or fancy ... a text file is fine. Please, HG, communicate with your clients, please?
Jeff_s HG Reseller |
|
#9
|
|||
|
|||
|
Quote:
|
|
#10
|
|||
|
|||
|
I use mod_rewrite throughout my entire main site. Reading through the documentation of problems with Wordpress' rewrite engine, I'm concerned that my own current rewrite rules may not work as intended with PHPSUEXEC. Can you please clarify any potential problems, and the workarounds?
|
|
#11
|
||||
|
||||
|
one of my clients is using phpBB with template_file_cache.php. This means there is a directory with 777 permission that I have to check everyday if something strange is there... (the directory is .htaccess protected but still)
Quote:
Vt
__________________
Vtrain is Linux User #237333 on http://counter.li.org/ "Don't meddle in the affairs of sysadmins, for they are subtle and quick to anger." |
|
#12
|
|||
|
|||
|
Quote:
|
|
#13
|
||||
|
||||
|
This sounds awesome, from the way I understand it, because I've had terrible troubles with Joomla sites lately.
|
|
#14
|
||||
|
||||
|
Quote:
I can chmod the directories to 755 (per instructions), but the files in the directory are a mix of owner "user" and "nobody". Will I need to chown the files to "user" or can PHP scripts running as "user" under PHPSuExec be able to write to 755 "nobody" files? |
|
#15
|
||||
|
||||
|
Quote:
Quote:
Directories will have to be 755 always. 777 will generate an internal server error as well. Quote:
Quote:
Basically PHPSuExec has the same rules as CGI's SuExec. Same rules, same precautions, same errors. This will be good as it will force you to make your scripts secure.
|
|
#16
|
||||
|
||||
|
Will this affect my osCommerce site at all? I have several LIVE sites that use osCommerce (using PHP and MySQL) and I cannot afford to have any problems.
Do I have to make any changes? |
|
#17
|
||||
|
||||
|
I know it will affect Zen cart as they will have the permission issues as I believe oscommerce has the same permissions. Trying to watch for the change as we have several carts and gallery sites to take care of when the change occurs.
__________________
best regards, George |
|
#18
|
|||
|
|||
|
Quote:
The other route is to change the permissions and php_flags manually. |
|
#19
|
||||
|
||||
|
Unfortunately, our osCommerce installation is about 50% customized with literally hundreds of modifications and improvements. We would have to make changes manually to whatever files HostGator mentioned. It's impossible to use Fantastico to reinstall.
May I request not updating our server since it would be a HUGE problem for us if something breaks? In the alternative, can HostGator check what exact changes will need to be made vis-a-vis osCommerce (if different from what already mentioned in this thread) and post a step by step of what we would need to change on our end. Thanks! |
|
#20
|
||||
|
||||
|
Quote:
|
|
#21
|
||||
|
||||
|
GatorAndre,
SuExec can be enabled/disabled in WHM, is the same true for PHPSuExec? |
|
#22
|
|||
|
|||
|
Quote:
Quote:
WHM » Software » Apache Update (you should enable PHP suEXEC Support) |
|
#23
|
||||
|
||||
|
Quote:
|
|
#24
|
||||
|
||||
|
I got one crazy question here, if I enable PHPSuExec,
Could this mean that it could help the Mambo user on my server that I have to always "chmod -R" new folder they upload via the admin interface in a .zip files to work properly as soon as they upload it? and not me having to "chmod -R" every time a new modules or new components is installed and the client has to email me the new components to me so I can chmod -R? I got this weird issue with those mambo project website on my server about uploading new components and user are not able to access it or open it after they have upload it via the Admin Interface. I should check the user group to see to who it comes after they upload also next time.
|
|
#25
|
||||
|
||||
|
Quote:
When Mambo is running as the user of the website there is no need any more to chown files/directories ![]() Quote:
__________________
quietFinn - netFinn Finland "Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." - Dr. Seuss |
![]() |
| Bookmarks |
| Thread Tools | |
|
|