[Solved] ReWrite issues

Discussion in 'Install/Configuration' started by netjess, Aug 18, 2011.

  1. netjess

    netjess New Member

    I have moved my site from one server to another server, The server name is the same, the sitename is the same and the paths are the same, only the IP is changed.
    MySQL is working and has connection. I can see it from the ExpressionEngine Admin UI.

    The setup is Ubuntu 10.10 (Maverick), LiteSpeed web server v4.1.3, Magneto v1.10.0.1, ExpressionEngine v1.6.9, MySQL5.

    The navigation items are not showing up.
    In LiteSpeed I am getting errors like the following:

    File not found [/var/www/dev/htdocs/htdocs/corps]
    File not found [/var/www/dev/htdocs/corps/_includes/nav/]
    File not found [/var/www/dev/htdocs/corps/_includes/footer-nav/]
    File not found [/var/www/dev/htdocs/profile/index/getinvites]

    The ../htdocs/corps/ directory is our ExpressionEngine install.

    I do not understand why it is looking for a file system path to the dynamicly produced _includes shouldn
  2. netjess

    netjess New Member

    Why is my post truncated?
  3. netjess

    netjess New Member

    I do not understand why it is looking for a file system path to the dynamicly produced _includes shouldn’t it just be a URL?

    My developer pointed out that is was a rewrite issue. I checked and compared this dev site to the production site and all ofthe settings are the same as seen from the admin UI.
    If I enable rewrite in LSWS admin ui the CPU spikes and server is all but unusable after the first page request.
    I also could not set rewrite from admin console I had to edit the VH conf XML.
    Here is the rewrite section of the htaccess file:
    ############################################
    ## you can put here your magento root folder
    ## path relative to web root

    #RewriteBase /magento/

    ############################################
    ## workaround for HTTP authorization
    ## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    ############################################
    ## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

    ############################################
    ## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

    ############################################
    ## rewrite everything else to index.php

    RewriteRule .* index.php [L]

    </IfModule>
    ############################################


    Thanks for any assist.
  4. webizen

    webizen New Member

    pls enable rewrite logs (Admin CP -> Configuration -> Virtual Hosts -> vhost -> Rewrite) and set log level to none zero to see why it does not work as expected. the log entries should appear in error.log (e.g. /usr/local/lsws/logs/error.log) with [REWRITE] tag.
  5. netjess

    netjess New Member

    ReWrite enabled

    I have tried this with the log set on 0 and 5. both ways the server becomes unusable and I have to force a reboot.

    I am attaching a sample of the log during one of the times it was enabled.
    complete log was too large to upload and that was after only a few minutes.

    Thanks.

    Attached Files:

  6. netjess

    netjess New Member

    Any idea why I cannot modify the rewrite feature via the Admin CP and have to directly edit the vhost xml?
  7. webizen

    webizen New Member

    At the upper right corner of the Rewrite Rules box, there is an "Edit" link. You need to click that to add/modify rules.

  8. netjess

    netjess New Member

    Yes, I am aware of how to change the settings. The settings do not remain when set by that method.
  9. webizen

    webizen New Member

    the vhost xml file needs to be owned and writable by lsadm user.
  10. netjess

    netjess New Member

    The vhost.xml is owned by lsadm. It was created from the Admin CP. It just won't allow change to the rewrite settings. I have made changes to the Basic, General and Log tabs.
  11. webizen

    webizen New Member

    this is odd. is it possible to pm us your server access info and let us take a look?
  12. netjess

    netjess New Member

    I could. Is SSH sufficient or I would have to do some kind of web-ex type connection. The server in question is not exposed to the Internet.
  13. webizen

    webizen New Member

    ssh is enough.
  14. webizen

    webizen New Member

    the vhost.xml along with the folder hosting the xml file need to be owned and writable by lsadm user. they are owned and writable by www-data instead which is the cause of the problem.
    when trying to change in Basic tab, got this error "*file $VH_ROOT/conf/vhostconf.xml is not writable". Basic, General, Rewrite tab can not be modified via Admin CP due to the said reason.
  15. netjess

    netjess New Member

    Well what could make that change? I built the server and installed LSWS. When setting up the site I had to mkdir /var/www/dev.grunt.com/conf and then chown it to lsadm in order to create the vhost.
  16. netjess

    netjess New Member

    Can you tell me what the impact would be of having the rewrite rule in LSWS and in the htaccess file would be? Would it conflict or would it be ignored?

    Thanks.
  17. netjess

    netjess New Member

    Also, after chown of conf directory and contents to lsadm and editing the rewrite, CPU again goes through the roof.
  18. netjess

    netjess New Member

    It looks like even after I issue "/usr/local/lsws/bin/lswsctrl stop", lsphp5 processes continue to consume resources.
  19. webizen

    webizen New Member

    Rewrite rules in LSWS take precedence over htaccess (just like the rules in Apache httpd.conf).

    Syntax is slightly different just like the ones in httpd.conf and htaccess (just like Apache).

    it is recommended that rules be put in one place (either LSWS or htaccess).

  20. netjess

    netjess New Member

    So can you think of any reason that my htaccess entry would be ignored?
    Is this applied recursive or only to the directory it is found in?

    ############################################
    ## rewrite everything else to index.php

    RewriteRule .* index.php [L]

    </IfModule>
    ############################################

Share This Page