[Solved] ReWrite issues

netjess

Active Member
#1
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
 

netjess

Active Member
#3
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.
 

webizen

Well-Known Member
#4
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.
 

netjess

Active Member
#5
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.
 

Attachments

netjess

Active Member
#10
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.
 

netjess

Active Member
#12
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.
 

webizen

Well-Known Member
#14
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.
webizen@vmlinux01:/var/www/dev.grunt.com/conf$ ls -l
total 8
-rw-r--r-- 1 www-data www-data 659 2011-08-18 11:49 vhostconf.xml
-rw-r--r-- 1 www-data www-data 364 2011-08-15 14:29 vhostconf.xml.bak
webizen@vmlinux01:/var/www/dev.grunt.com/conf$ ls -ld .
drwxr-xr-x 2 www-data www-data 4096 2011-08-18 11:49 .
webizen@vmlinux01:/var/www/dev.grunt.com/conf$
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.
 

netjess

Active Member
#15
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.
 

netjess

Active Member
#16
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.
 

webizen

Well-Known Member
#19
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).

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.
 

netjess

Active Member
#20
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>
############################################
 
Top