Page 1 of 1

XML file sharing between two servers

Posted: Fri Jul 31, 2009 12:25 pm
by avvarde
I got two servers: Webserver (Windows-IIS/php) and Linux Execution server (I can put an Apache server if its needed)

My php app on the WebServer generates a xml file which will be used by a command executed on the linux server.
What is the best way to configure these two server?

Re: XML file sharing between two servers

Posted: Fri Jul 31, 2009 2:29 pm
by joeynovak
The awesome thing about webservers, is that they are just another way to share files... I would recommend putting the generated XML file someplace that the linux box can access it via http (i.e. someplace on the php server that the linux box can access it over the web, if you are worried about security, just setup a .htaccess on the file that only allows the linux boxes ip address to get anything in the directory), and then use wget (you probably want to add the right arguments to wget so that it overwrites the file when it downloads it, instead of doing it's default behaivor where it appends a .N to the end) to fetch the xml file before running the linux command... It will make things REALLY simple.

Good luck!

Joey

Re: XML file sharing between two servers

Posted: Fri Jul 31, 2009 2:42 pm
by VladSun
If both machines are in the same network segment you can simply share the directory containing this file ("File and printer sharing") and access this shared folder from the Linux server by using this commands:

Code: Select all

mkdir /mnt/win-shared
(run once)

Code: Select all

mount -t smbfs -o username=user_name_with_access,password=user_password //192.168.2.180/shared /mnt/win-shared
(run at start up)

where:
/mnt/win-shared is the Linux directory where the Windows shared directory will be accessible
user_name_with_access -....
user_password -....
//192.168.2.180/shared - the address of the Windows machine together with the shared folder.