|
|||
|
enabling mod_rewrite module in http.conf
Hello everybody,
I am new to this forum. I want to enable mod_rewrite module since I want to add few of the codes in the .htaccess file that is used in uploading images with more than 2 MB. I am having problems in uploading images with more than 2 MB. I also tried to use custom php.ini file. I also tried to use .htaccess file. .htaccess file works well locally but when I tried to use it in this server it generates an error and I cannot browse any of the pages. I can easily connect to the SSH using PUTTY. I want to enable mod_rewrite so that it supports .htaccess codes. Please help me on this. how can I make this work. Thanks a lot. |
|
||||
|
Runee:
It sounds like that what you are doing isn't mod_rewrite commands as you claim but rather you are really trying to change the PHP upload limit using your .HTACCESS. Unfortunately, using "php_flag" and "php_value" commands to override configuration values in PHP only work on those servers where PHP has been installed as an insecure Apache DSO module (Usually running as the generic user "nobody"). (This configuration is not recommended because of major security issues) Dropping in a new custom PHP.INI file into your account home only works to override PHP configuration settings if the PHP on the server has been configured to operate as a CGI directly or as the obsolete and now rarely used configuration mode called phpSuEXEC which was one of the legacy methods used in the days before SuPHP came along to run scripts as the account owner instead of user "nobody" but it had it's own set of problems. Those server which are properly configured today, are now mostly all running SuPHP which is structured as a special DSO module which in turn calls the PHP CGI binary and executes the user PHP scripts under the owner username and unlike the previous two styles of PHP, SuPHP doesn't have either of the major security issues or inherent problems found in the earlier PHP installations. Likewise, the methods of setting up the configuration commands are also different as well and configuration override commands can still be setup but most be setup in one of the following forms when the server is running PHP as SuPHP: 1. Editing the main server PHP.INI file (usually in /usr/local/lib) 2. Overriding the PHP settings in the virtualhost container in the main httpd.conf file (located in /usr/local/apache/conf) 3. Creating a custom PHP.INI file located in /usr/local/lib/php.ini.d or in a location specified by the server administrator using the a "suPHP_ConfigPath" directive in httpd.conf for your account. 4. Some, but not all, directives can also be changed from within your PHP scripts using the set_ini() command unless the server administrator has restricted this function with disable_functions(). One significant difference between SuPHP based PHP and the others is that end users CANNOT override server PHP settings unless explicitly allowed for by the server administrator and the server administrator retains control as to who can and cannot update PHP settings which is a significant improvement over the other legacy methods of installing PHP which allowed for the end user to edit too many settings Quote:
and attempting to add commands to your .HTACCESS file will just cause your web site to generate an error 500 condition and block your web site from working. Since your server is clearly running the newer SuPHP instead of the old phpSuExec, this would be the reason why dropping in a custom php.ini file did not work for you either as this is not permitted under SuPHP unless explicitely setup by the server administrator. To make the PHP settings changes you requested, you will need to have the limits raised for PHP uploads either increased server wide across the whole server (OR) use one of the valid methods of changing the settings I mentioned previously earlier in this post which does not involve editing the .HTACCESS file or dropping in custom PHP.INI files unless you have been setup by the server administrator permission to be able to do that. .
__________________
My Server Expert: Cloud VPS servers w/Cpanel, Security Hardening, Management, and Monitoring! Last edited by Spiral; 07-01-2009 at 03:58 AM. |
|
|||
|
http.conf
Hello Spiral,
Thanks for your prompt reply. 1. Editing the main PHP.INI file (usually in /usr/local/lib) I tried this first one but it didnt allowed me to save the php.ini file after editing 2. Overriding the PHP settings in the virtualhost container in the main httpd.conf file (located in /usr/local/apache/conf) I didnt find the apache folder under the local directory. where can I find this. 3. Creating a custom PHP.INI file located in /usr/local/lib/php.ini.d or in a location specified by the server administrator using the a "suPHP_ConfigPath" directive in httpd.conf for your account. waiting for your reply thanks |
|
||||
|
Quote:
in order to be able to edit and save the primary PHP.INI file for the server. If you do not have "root" access then you cannot update this file and you will need to contact your server administrator to help you! Otherwise, don't forget to restart your apache server process after updating the PHP.INI file using the command 'service httpd restart' after you finish making the changes to your configuration. Quote:
You must be logged in as "root" in order to edit any server wide configuration files. An alias (symlink) folder for /usr/local/apache on most Cpanel servers is /etc/httpd Quote:
server instead of making changes for the entire server globally, you will need to create a copy of the PHP.INI file found in /usr/local/lib saved to a new PHP.INI file stored at some other new location and then add the suPHP_ConfigPath directive the the VirtualHost section of HTTPD.CONF for the account where you want the custom changes to appear and tell the server where you saved your new custom PHP.INI so it can be used with the account where you want the changes. (Click to see suPHP - Documentation for more information on updating SuPHP settings) If you do not have access as "root" then you will need to contact your server administrator and request assistance making these changes. Without root access, you may still be able to change some options using the ini_set() function from within your PHP scripts directly but you would be limited in what settings you could change.
__________________
My Server Expert: Cloud VPS servers w/Cpanel, Security Hardening, Management, and Monitoring! Last edited by Spiral; 07-01-2009 at 04:40 AM. |
![]() |
| Tags |
| .htaccess , max file upload size |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I edit the http.conf file? | everyaa | cPanel and WHM Discussions | 2 | 12-05-2005 01:22 PM |
| http conf error? | NocTurNalFX | cPanel and WHM Discussions | 8 | 06-19-2005 01:43 PM |
| about CGI http.conf | typer | cPanel and WHM Discussions | 2 | 03-02-2004 01:09 AM |
| mod_rewrite module | compunet2 | cPanel and WHM Discussions | 0 | 07-26-2003 02:06 PM |
| Duplicate HTTP.CONF entries | autson | cPanel and WHM Discussions | 2 | 08-01-2002 12:53 PM |