LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2009, 10:18 AM   #1
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
FTP server -> NFS -> HTTP/SQL server


Hello,

I'm in quite of an unpleasant situation at the moment. I have 2 servers, FTP server and HTTP/SQL server, they are both on different locations, different ISP etc. And I have an VPN link between them.
To discribe a little bit further, I want the users to be able to access only the FTP, to upload files, and then through HTTP to view their websites.
So I went and installed ProFTPd on the FTP server, configured it, made a user adding script and it works just fine.
Then I created a NFS link between the server and am mounting the the root FTP directory in the HTTP server, which does mount.
And after that, configured apache to read from those user directories, which again works ok. But the problem becomes when apache needs to write to some of those directories, and permission get's denied, altho I have set the rw flag, both in the exports file and the mount command/fstab file. Even if I set file permissions to apache:apache on the FTP server it still can't write. What could be the cause of that? Or is there any better way to do this?

Kind regards,
xfirestorm
 
Old 10-11-2009, 12:55 PM   #2
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 39
NFS's permissions are based on file ownership denoted by uid. Are the uids of the users apache and ftpd runs as the same?

Remove the services from the situation for now, can *anyone* write to the nfs mount?

What's the line in /etc/exports and /etc/fstab as appropriate from the two boxen?


As for better ways, an other way to do it would be to install apache on the ftp server, and have the current http server act as a proxy. This is likely to be suboptimal for the same reasons as why you've ended up with two different servers.
 
Old 10-12-2009, 03:00 AM   #3
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Original Poster
Rep: Reputation: 37
/etc/exports:
Code:
/var/ftp/users/x        10.8.0.1(rw,sync)
and output from mount(I don't use fstab yet, untill I set it up as I should):
Code:
-bash-3.2# mount
/dev/hda1 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda2 on /home type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/dev/md0 on /mnt/raid type ext3 (rw)
10.8.0.14:/var/ftp/users/x on /home/test type nfs (rw,addr=10.8.0.14)
Hmm...a reverse proxy? Wonder why I never gave that a thought.
Ok then, maybe not so much of a networking question anymore, or maybe so.
In that case, I would need a way to, configure both servers over the network, one way would be to share those configuration files over NFS?
I.e., I have this server for user websites, who don't have any access to the server, except for HTTP and FTP(SQL local only). The FTP server doesn't even have SSH access(it's blocked by a router firewall), except over VPN. But what I would like to do now is log in through SSH on my current HTTP server and configure everything from there. A new website directive as reverse proxy in current apache, add new user and create directories for the user on the FTP server, and configure apache on the FTP server for the new user. Which I think could be done by mounting those files and directories over NFS and manipulate them in this way.
But then the question comes, how do I restart the apache on the FTP server remotely?
 
Old 10-15-2009, 05:50 AM   #4
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 39
Your exports and mount look about right to me (I can't remember the default status of root_squash, but on is generally sensible)

Quote:
In that case, I would need a way to, configure both servers over the network, one way would be to share those configuration files over NFS?
I'd look at NIS for sharing user info, but the configuration of most of the services (http, ftp, ...) will be different between the boxes. NIS would simplify your NFS woes, too.
LDAP can be used for same, and is more recently proving more popular. But it's substantially less simple than NIS.

Last edited by Lordandmaker; 10-15-2009 at 05:50 AM. Reason: s/code/quote/
 
Old 10-15-2009, 03:35 PM   #5
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Original Poster
Rep: Reputation: 37
I don't need to share user info. All the users that have to exist, will be on the FTP server, which are created with a local bash script. Only SQL users will have to be created on the HTTP server. But if I use a reverse proxy, I need to edit both httpd.conf files on both machines, and restart/reload apache on both machines. Which I already solved with ssh public key logins and executing remote scripts.
root_squash defaults to on/yes, at least it's there in /proc/nfs/exports
Thanks for the help both of you, but this can be marked solved.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to install RHEL5.0 on Dell Optiplex 755 desktop through NFS,HTTP,FTP server" subrata2k6 Linux - Networking 4 09-29-2009 06:22 PM
help me regarding network instllation from ftp http and nfs server kukusuku Linux - Networking 1 02-21-2009 03:19 AM
Not able to install RHEL5.0 on Dell Optiplex 755 desktop through NFS,HTTP,FTP server" subrata2k6 Linux - Networking 1 08-01-2008 01:46 AM
Hosting an FTP? And a mail server? And a php/sql wiki? Deecie Mandriva 1 05-28-2004 07:09 AM
HTTP/FTP server on Virtual PC colelinux Linux - Networking 0 11-14-2003 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration