XML file sharing between two servers

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
avvarde
Forum Newbie
Posts: 4
Joined: Wed Jul 22, 2009 8:12 pm

XML file sharing between two servers

Post 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?
joeynovak
Forum Commoner
Posts: 26
Joined: Sun May 10, 2009 11:09 am

Re: XML file sharing between two servers

Post 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
Last edited by joeynovak on Fri Jul 31, 2009 3:16 pm, edited 1 time in total.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: XML file sharing between two servers

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply