The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

weird FTP and mod_rewrite Problem

Discussion in 'General Discussion' started by sniperscope, Jun 7, 2011.

  1. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Hi there
    I have two(actually three) problems that i faced today.

    1 - I can connect my client's account via FTP but my next desk cannot. No matter what i did there was no change. Ftp program returns with "Invalid Password" error. But i have no problem with same Ftp program at exact same settings. Even i have no problem to connect from home pc.

    2 - This one almost same as #1 but in this case my next desk cannot connect mail client with windows live mail program but some how i and another pc are can connect mail server send/receive no problem.

    3 - My client's site has internal 500 error after a little search i figured out that .htaccess cause this problem. The problem is mod_rewrite. I search over internet for 4-5 hours but it did not succeeded. I cannot find any LoadModule rewrite_module modules/mod_rewrite.so line commented out. locate mod_rewrite also gave me no result.

    I need serious help now.

    Regards
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    201
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    1 and 2, not sure what next desk is exactly.

    3, is the server running SuPHP? Does the site work if you rename the .htaccess file to .htaccess.txt and try the site?

    If yes, and yes, can you post the contents of the .htaccess file here if possible?
     
  3. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Dear infopro

    Next desk is window@ xp pro os just a simple ps as mine in the office even as same ps which i am typing this message.

    Your question. Yes and yes. My server running Suphp and site is working after change .htaccess file into htaccess.html

    Here is entire htaccess file

    AllowOverride Options
    AddHandler cgi-script cgi pl
    Options +ExecCGI

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(clients-site\.net):)80)? [NC]
    RewriteRule ^(.*) http://www.clients-site.net/$1 [R=301,L]
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{THE_REQUEST} ^.*/index.html
    RewriteRule ^(.*)index.html$ http://www.clients-site.net/$1 [R=301,L]

    <Files ~ "\.(htaccess|txt|xml|htpasswd)$">
    SetEnvIf User-Agent "Slurp" allow_ua
    SetEnvIf User-Agent "Y!J" allow_ua
    SetEnvIf User-Agent "slurp" allow_ua
    SetEnvIf User-Agent "Googlebot" allow_ua
    SetEnvIf User-Agent "msnbot" allow_ua
    order deny,allow
    deny from all
    allow from env=allow_ua
    allow from msn.com
    allow from www.xxx.yyy.zzz
    </Files>

    SetEnvIf User-Agent "Baiduspider" shutout
    order allow,deny
    allow from all
    deny from env=shutout

    RewriteCond %{HTTP_USER_AGENT} DoCoMo [OR]
    RewriteCond %{HTTP_USER_AGENT} J-PHONE [OR]
    RewriteCond %{HTTP_USER_AGENT} Vodafone [OR]
    RewriteCond %{HTTP_USER_AGENT} SoftBank [OR]
    RewriteCond %{HTTP_USER_AGENT} UP.Browser
    RewriteRule ^$ /m/ [R]
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    201
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Cool, so you know there is some sort of problem with the htaccess file. What that problem is you'll have to track down by trial and error I suppose, figuring out what parts of that file you need and don't need. (and whats breaking the site of course)

    GL!
     
  5. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Thank you for your reply but honestly this is not the answer i was expected for.
    So could you tell me how can i enable mod_rewrite? Because i don't see any commented out option in my http.conf file for LoadModule rewrite_module modules/mod_rewrite.so and AddMod.... too.
    I do not want to change anything that i don;t fully understand what am i doing. Because my system was refused to boot up when i changed something last time when i touch it and i had to install entire os , set up networks and whm/cpanel aswell and it took my 9 hours sleepless night.
    But this time i have real client in my server. So, i am seeking help for hopeless
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    201
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    My apologies for not being clear.

    It should be enabled by default already, no need to be concerned on that part of this.

    The problem is in that htaccess file. So to attempt to solve, and I don't know much of what you've got going on in that htaccess, but now that you have the site up, and that htaccess renamed, create a new blank one: .htaccess

    In your old htaccess it appears you have it broke up into sections. Add one section back at a time that you are sure you need, save and see if the site still works. When you get to the one that breaks the site, don't use it, or find another way to do what you're doing with it.

    Thats the short answer. The long answer explains all that you have going on in the old htaccess to you so that you understand it properly and explains which one of those lines is breaking your site. I can't help there myself with that.

    Short of waiting for someone that can, you could troubleshoot these one at a time as metioned and probably find it quick enough on your own.

    I hope that helps more.
     
  7. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Dear infopro
    I found the problem.
    The problem is from here:

    AllowOverride Options
    AddHandler cgi-script cgi pl
    Options +ExecCGI

    What is it doing? I is simply let cgi scripts run outside oof cgi-bin directory. So i delete those lines and site working as it should.

    Thanks for helping.

    BTW: I figured out my another problem (FTP) my ftp program says can not connect because too many connection from this IP address. Is there anyway to bypass this problem?
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    For FTP connections from the same IP, it is WHM > FTP Server Configuration > Maximum Connections Per IP Address option. You could increase that to allow more connections.
     
  9. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Dear Tristan
    You are a time saver.
    Thanks for information.
     
Loading...

Share This Page