[sclug] Re: Uploading a website to host
Graham
lists at Information-Cascade.co.uk
Tue Aug 30 15:20:20 UTC 2005
If I have many files to transfer, and general gardening,
I use text mode 'mc' midnight commander, if thats news to you,
try it out with these (F9) settings:
lynx like motion - yes (strangely missing from several distros)
always pause after command - yes
use internal edit - YOUR CHOICE - I prefer external $EDITOR
-save-settings-
confirm exit - no
To make it connect:
F9
left panel
FTP link
user:pass at www.site.isp.net
Use CTRL-\ to 'bookmark' the connection (once established)
That will be saved when you exit mc (beware of other sessions overwriting)
It caches the FTP dir-reads, so CTRL-R if directories appear undeleted.
It times out and disconnects, so keep active.
If I have one file to send, I place it in my local tree,
and use curl to send it, with a script like this: http://curl.haxx.se
#!/bin/sh
# $1 is RELATIVE PATHNAME/FILENAME
user=me at isp.net:password # or -n to use netrc
file="${1:-index.html}"
udir=ftp://www.information-cascade.co.uk
udir=$udir/htdocs
fdir=`dirname $file`
case $fdir
in
.) fdir=""
;; *) fdir=$fdir/
esac
udir=$udir/$fdir
set -x
curl \
--user $user \
--upload-file $file \
$udir \
2>&1 | tee fa
> On Mon, 2005-08-29 at 20:47 +0100, Stuart Major wrote:
> I have created a website using phpwebsite and have a host set up. Can
> anyone tell me how to upload the site to the host server?
every php server is slightly different.
Some are older, and the php langauge changes.
Some have specific facilities switched OFF for security
Some run on read-only NFS, which prevents (lots of things)
SO ...
... test it carefully
It might help to run this script on the web server, and keep the results
<?php
phpinfo();
?>
> I think I need to use ftp but I'm not sure of the details. Any advice
> would be most welcome.
There are ftp interfaces in most scripting langauges, such a Tcl or even PHP.
The main problem is deciding which file needs to be sent.
There are FTP filesystems, which do the work, but the last time I looked,
they were experimental, and kept timing out badly.
PHP (in web server) has an upload facility, that uses HTTP put.
If that isnt switched off, you could write your own script
that checks your IP address and (NEW) password then places
the new file in the right place (check phpinfo).
There is also (search) ftp mirror, which is usually used to FETCH as ANONYMOUS,
but it does all the work of comparing file dates with the local tree.
You will need PASV as the other emails suggest,
because your ADSL router - "firewall" - will probably reject the (incoming)
data connection that the (outgoing) control connection requests.
You may or may not need the ASCII/BINARY setting, which tells ftp to/not
convert CR-LF line-endings. .png's and .gif's need to be unmodified BINARY.
Its probably OK to leave PHP scripts in unix LF format, so all binary :-)
--
Graham
gps @
www . Information-Cascade .co.uk
More information about the Sclug
mailing list