Go Back   cPanel Forums > General Discussion > cPanel Newbies

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-2009, 02:42 AM
Registered User
 
Join Date: Jul 2009
Posts: 2
runee is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-01-2009, 03:06 AM
Senior Member
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,535
Spiral is on a distinguished road
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:
Originally Posted by Runee
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. Using .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.
The statement you made tells me that the server you are using has PHP installed as SuPHP
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.

.
__________________
[b][color="Blue"]Server Support[/color]: [color="Red"]Server consulting, security, and management![/color][/b]

Last edited by Spiral; 07-01-2009 at 03:58 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-01-2009, 03:35 AM
Registered User
 
Join Date: Jul 2009
Posts: 2
runee is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-01-2009, 04:32 AM
Senior Member
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,535
Spiral is on a distinguished road
Quote:
Originally Posted by runee View Post
[B]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
You have to be logged in via SSH to your server as the "root" administrator
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:
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.
It sounds like you are not logged in as "root" or are logged in using a restricted jailshell.

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:
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.
To create a custom PHP.INI file setup for a specific hosting account on your
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.
__________________
[b][color="Blue"]Server Support[/color]: [color="Red"]Server consulting, security, and management![/color][/b]

Last edited by Spiral; 07-01-2009 at 04:40 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-01-2009, 06:08 AM
Infopro's Avatar
Forum Moderator
 
Join Date: May 2003
Location: Pennsylvania
Posts: 3,762
Infopro is on a distinguished road
Lightbulb

Quote:
Originally Posted by runee View Post
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.
mod_rewite should be enabled by default on your server. If not, rebuilding apache should take care of that.

Quote:
Originally Posted by runee View Post
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.
You can edit the server's PHP Configuration from within WHM.

If you don't have root access to do either of these you'll need to speak to your host.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
.htaccess , max file upload size

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -5. The time now is 08:45 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc