LinuxNetMag
Web-Publishing automatically? Sitecopy!
List | Home
TOC
   
LinuxNetMag #3

  Software
 MP3
Xaudio, xmms, mp3blaster
freeztag, kmp3te
 Games
TTY-Quake, Quake3Test
Descent, LDescent, DX1
Flightsimulators
 Applications
Wine: Installation and Setup
VCron, Kcrontab
Passwords with Gpasman
 Misc.
Bootlogos: Welcome2L...
[email protected] and tools
Lightspeed
  
 

Network

Alternative Web-Browser
Linpopup
VNC - Windows X-Server
Fetchmail Part II
Apache the webserver
Windows networks: Samba
Webpublishing: Sitecopy
downloadhelp Wget
Webalizer
recommended links
  
 

Hardware

HD-/Floppy- Access
Jslaunch
  
 

Misc.

Editorial
Guestbook
Mailingliste
Complete list of articles



printer-version


 

Webserver
Do you maintain one or more home pages on different servers which you keep updated regularly?
Then you know the horror of these multiple FTP uploads.
For this, sitecopy helps perfectly!


Upload it Automatically
Who does not know the problems maintaining their own home page? You changed some pages, hardly remembering which ones these were. Then you get an awful FTP connection to a server that crashes often and is so slow that it takes years to finish. Sitecopy is the solution for these problems. It keeps the files on the server and the files on your local disk always identical.
 
 

Webpage Mirror

It is recommended that your several sites maintained on your local disk are accessible with your local web server. This setup offers you the possibility to find corrupted links and be able to run CGI scripts (see also the article about apache). Be careful that you just use relative links instead of absolute links. Then the sites work on both servers.

If you own two homepages for example, one at geocities and one at tripod, then you should create two directories in your webserver:

>> mkdir /usr/local/httpd/htdocs/geo cities
>> mkdir /usr/local/httpd/htdocs/tr ipod

(/usr/local/httpd/htdocs is the directory where the webserver keeps its sites in the SuSE distribution - this might be different for others - and copy the sites into them.

Now you have to configure sitecopy so that it knows which directories have to be mirrored and to which FTP-server the files have to be copied. This is handled in the file .sitecopyrc which has to be placed in your home directory.

First you create the file with :

>> touch ~/.sitecopyrc

and then edit it with a simple word processor.
 

File ~/.sitecopyrc
site tripod # Every homepage gets a name
        server ftp.tripod.com # the FTP-Server
        username joe # Login-Name of the FTP-Server
        password joespasswd # The passwor d for the login
#       exclude *.cgi  # do not upload .c gi-files
        remote / #at Tripod the home dire ctory is /
        local /usr/local/httpd/htdocs/tri pod/ # The local directory of the files

site geocities
        server ftp.geocities.com
        username joe2
        password joepaswd2
        remote ~/  # at geocities ~/ is the home directory
        exclude geobook.html # Do not upl oad the guestbook!
        local /usr/local/httpd/htdocs/mir ror/

Every site gets a specific name that is needed to steer it later.

If the files in the Internet were the same as the local files, you would tell sitecopy this by typing:

>> sitecopy -c -a

If not, it is recommended that you delete all files on the FTP server and upload them completely with :

>> sitecopy -u -a

Now the local and Internet sites are synchronized. If you changed, deleted or created a new file or directory sitecopy would recognize it and adjust the files and directories on the FTP-server to mirror the local structure.
 
 

In the Background

It makes sense to add the sitecopy call into the script /etc/ppp/ip-up so you do not have to start it by hand every time you are connected to the Internet. But pay attention - sitecopy has to be executed by the user who owns the .sitecopy file in the home directory. Because the ip-up script is executed by root you either have to copy the configuration file to /root/ or you start it as a different user:

>> su -c "sitecopy -u -a" <USERNAME>

From time to time, you should start sitecopy by hand so you can see if it interruptted the upload because of errors. This happens if it tries to create a subdirectory which already exists. These problems of synchronization could occur if the program was not stopped correctly. Also, CGI scripts need additional help because these are copied without executable rights to the server.
 
 

Frontend

A gnome frontend exists which does not want to compile with a SUSE distribution. But this is not so bad because sitecopy is one of those small tools that should just work in the background. A front end is completely unnecessary.

 
print
Other issues of Linux NetMag
[ #1 | #2 | #3 | Main ]