|
|

07-11-2011, 09:36 AM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 34
|
|
[Solved] NFS and LiteSpeed
Hello,
I have setup an NFS server to hold site files, I have two LiteSpeed servers with a load balancer and would like to use NFS rather than rsync to keep them the same.
The NFS server seems to work fine. I cann SSH into either of the web servers and create files from the CLI.
When I try to modify the VHOST to use the NFS mounted folder as the site root the admin UI gives me the error "*file /var/www/conf/sitename/vhconf.xml does not exist. Please create manually".
Then I look at the server log it has the following:
--------------------------------
[192.168.1.2:54372-0#_AdminVHost] [STDERR] PHP Warning: is_file() [<a href='function.is-file'>function.is-file</a>]: Stat failed for /var/www/conf/sitename/vhconf.xml (errno=13 - Permission denied) in /usr/local/lsws/admin/html.4.0.20/classes/ConfValidation.php on line 627
--------------------------------
The NFS share is mounted as /var/www/share
I am attemting to use the site as follows:
/var/www/share/sitename/
/var/www/conf/sitename/vhconf.xml <-- keeping the conf xml local.
I have tried to chmod and chown the folders to allow www-data access.
for the folder /var/www/conf/
drwxrwxr-- 3 www-data share 4096 2011-07-08 17:01 conf
I am not sure abot the part of the error "192.168.1.2:54372-0#_AdminVHost".
192.168.1.2 is not my IP or the IP of the web server. where is this comming from or is it not an IP?
Thank you,
|

07-11-2011, 10:19 AM
|
|
LiteSpeed Staff
|
|
Join Date: Oct 2010
Posts: 2,338
|
|
192.168.1.2 (internal IP) is the client IP. The error message indicates that NFS client (webserver) has no write permission to files on the NFS server. make sure folder /var/www/conf/sitename/ should be writeable by www-data.
Quote:
--------------------------------
[192.168.1.2:54372-0#_AdminVHost] [STDERR] PHP Warning: is_file() [<a href='function.is-file'>function.is-file</a>]: Stat failed for /var/www/conf/sitename/vhconf.xml (errno=13 - Permission denied) in /usr/local/lsws/admin/html.4.0.20/classes/ConfValidation.php on line 627
--------------------------------
|
|

07-11-2011, 10:52 AM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 34
|
|
|
192.168.1.2 is not my workstation IP or the IP of the web server (it is the IP of my proxy).
Also /var/www/conf/sitename/ is a local path on the web server and not the NFS share.
I do not understand why it would be attempting to reference the proxy IP in a write attempt. I am doing all of this logged into the admin interface If I can loginto the admin UI why wouldn't it execute a change?
|

07-11-2011, 10:57 AM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 34
|
|
|
OK, just for giggles, I tried using Firefox with no proxy setings to log into the admin UI. It gives the same error even though Firefox is not using the proxy. So I still have not clue how it is getting the 192.168.1.2 IP.
|

07-11-2011, 11:49 AM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 34
|
|
|
Well, I really don't believe that it should be referencing my local IP as the source for a mkdir request. I added the following to the /etc/exports file on the NFS server:
/share 192.168.1.44(rw,sync,no_root_squash,no_subtree_che ck) 192.168.1.2(rw,sync,no_root_squash,no_subtree_chec k).
restarted NFS.
This still failed.
Last edited by netjess; 07-11-2011 at 11:50 AM..
Reason: the post showed unexpected spaces.
|

07-11-2011, 12:04 PM
|
|
LiteSpeed Staff
|
|
Join Date: Oct 2010
Posts: 2,338
|
|
it depends on your local routing table as to why your local IP is used as source.
Regarding permission issue, create test file in /var/www/conf/sitename/ (which is local on the web server) as www-data from CLI and see if it works. i.e., run below as root
Quote:
cd /var/www/conf/sitename
su -c 'touch test' www-data
cd /var/www/share/sitename/
su -c 'touch test' www-data
|
Regarding your nfs share setup, you should have the IP for your webserver IP listed as client instead of 192.168.1.2 (end user).
Last edited by webizen; 07-11-2011 at 12:12 PM..
|

07-11-2011, 12:15 PM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 34
|
|
|
About the NFS setup I do have the web servers IPs in there. I just added my local IPs since it appeared it was attempting to write as if from there.
/etc/exports:
/share 199.204.136.47(rw,sync,no_root_squash,no_subtree_c heck) 199.204.136.48(rw,sync,no_root_squash,no_subtree_c heck)
/share 192.168.1.44(rw,sync,no_root_squash,no_subtree_che ck) 192.168.1.2(rw,sync,no_root_squash,no_subtree_chec k)
----------------------------------------------
Regarding testing www-data account, do you know what password I would use or do I need to reset the password for www-data account? Isn't that account auto generated when you setup the web server?
Thank you.
|

07-11-2011, 12:21 PM
|
|
LiteSpeed Staff
|
|
Join Date: Oct 2010
Posts: 2,338
|
|
Quote:
Originally Posted by netjess
...
Regarding testing www-data account, do you know what password I would use or do I need to reset the password for www-data account? Isn't that account auto generated when you setup the web server?
|
If you run the command (i.e., su -c 'touch test' www-data) as root user, you should not be prompted for password.
|

07-11-2011, 12:21 PM
|
|
Member
|
|
Join Date: Mar 2011
Posts: 34
|
|
|
OK, well I used "sudo su -c 'touch test' www-data" and passed the password of the user I was ssh'd and that worked just fine.
|

07-11-2011, 12:30 PM
|
|
LiteSpeed Staff
|
|
Join Date: Oct 2010
Posts: 2,338
|
|
|
also make sure admin server user (i.e., lsadm) has write permission.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:57 AM.
|
|