Re: web server for development
On 2020-01-18 20:09, Russell L. Harris wrote: On Sat, Jan 18, 2020 at 07:21:43PM +0100, deloptes wrote: mick crane wrote: I scp the files to a temp directory in my home directory on the server then ssh into the server, su to root, change the permissions and ownerships of the files then move them to /var/www/html/ for testing I usually configure something meaningful in apache and setup a user that I would use to copy to the server. Keep it as simple as possible. another option is to open the target directory and edit the code in place. For the purpose of interactive development as I proceed through the Template Toolkit tutorial in Chapter 11 of the O'Reilly Badger Book, the "$ python3 -m http.server" approach is both working and simple. Everything is in a single directory and only one machine is needed; neither file movement (scp, FTP, RSYNC) nor change of permissions is required. Was not this simple approach to serving HTTP available back in A.D. 2003 when the Badger Book was published? I'd not heard of this python webserver but then I haven't looked at python as yet. Tried to mimic locally wordpress that's on the hosting service. unsure if the python server would replace apache for that. -- mickiwiki.com Key ID4BFEBB31
Re: web server for development
On Sat, Jan 18, 2020 at 07:21:43PM +0100, deloptes wrote: mick crane wrote: I scp the files to a temp directory in my home directory on the server then ssh into the server, su to root, change the permissions and ownerships of the files then move them to /var/www/html/ for testing I usually configure something meaningful in apache and setup a user that I would use to copy to the server. Keep it as simple as possible. another option is to open the target directory and edit the code in place. For the purpose of interactive development as I proceed through the Template Toolkit tutorial in Chapter 11 of the O'Reilly Badger Book, the "$ python3 -m http.server" approach is both working and simple. Everything is in a single directory and only one machine is needed; neither file movement (scp, FTP, RSYNC) nor change of permissions is required. Was not this simple approach to serving HTTP available back in A.D. 2003 when the Badger Book was published?
Re: web server for development
mick crane wrote: > It's a bit convoluted. > I scp the files to a temp directory in my home directory on the server > then ssh into the server, su to root, change the permissions and > ownerships of the files then move them to /var/www/html/ for testing I usually configure something meaningful in apache and setup a user that I would use to copy to the server. Keep it as simple as possible. For example one default configuration in the past was the users public_html. another option is to open the target directory and edit the code in place. Most editors would upload the changes automatically
Re: web server for development
On 2020-01-09 06:16, Russell L. Harris wrote: For development of a web pages, I installed Apache2 on another machine in the LAN so that I can FTP web pages from the development machine to the web server and view the pages from the development machine. But the installation of Apache2 on Buster serves documents from /var/www/html/, which is owned by root, so as a normal user I cannot FTP into that directory. The web server is not exposed outside the LAN, so security is not an issue. What is the proper approach? It's a bit convoluted. I scp the files to a temp directory in my home directory on the server then ssh into the server, su to root, change the permissions and ownerships of the files then move them to /var/www/html/ mick -- Key ID4BFEBB31
Re: web server for development
Russell L. Harris wrote: > On Tue, Jan 14, 2020 at 07:56:41PM +0530, rajudev wrote: >> This is what I use when I am testing something on my local machine >> $ python3 -m http.server > > Thanks. Someone previously mentioned a phython server built into > hugo, but did not give details. ah, i didn't see a mention of hugo before in this thread $ hugo serve will do it... i make sure to cd into the production directory first before running that command or any other hugo command as you can get odd bits of stuff showing up in your directories otherwise. > This serves my need, and saves time by circumventing configuration of > apache. yes. it's pretty common in almost any web site development environment to have some kind of way to do this locally. also to test deployment from one place to another it is a good idea to have a separate service (even if it is simple) just to make sure you're getting things moved to where you want them to be. songbird
Re: web server for development
On Tue, Jan 14, 2020 at 07:56:41PM +0530, rajudev wrote: This is what I use when I am testing something on my local machine $ python3 -m http.server Thanks. Someone previously mentioned a phython server built into hugo, but did not give details. This serves my need, and saves time by circumventing configuration of apache.
Re: web server for development
On ९/१/२० ११:४६ म.पू., Russell L. Harris wrote: > For development of a web pages, I installed Apache2 on another machine > in the LAN so that I can FTP web pages from the development machine to > the web server and view the pages from the development machine. > > But the installation of Apache2 on Buster serves documents from > /var/www/html/, which is owned by root, so as a normal user I cannot > FTP into that directory. > > The web server is not exposed outside the LAN, so security is not an > issue. > > What is the proper approach? Might not be the answer you are looking for. This is what I use when I am testing something on my local machine or my local lan STEP I : Getting in the directory which hosts the pages STEP || *python3 -m http.server* it starts serving the web pages on that hosts ip and default port 8000 you can also specify different ports for different website folders $ *python3 -m http.server 3000* I also use the same trick to access files from another system over a web browser. This approach is fine for a test server. Dont expect serious configurations using this signature.asc Description: OpenPGP digital signature
Re: web server for development
There's also sftp. It's in the openssh-client package. Thanks; I see that it is loaded, and I just printed out the man page. ... a Windows person Them's fighting words... Or mounting the directory using sshfs (which is an SFTP client) and then using your local file management tools. sshfs sounds interesting. Or just logging in with ssh and using ls, if you get a reasonable shell on the remote system. The obvious, which I overlooked.. Thanks, Greg, for this re-orientation. RLH
Re: web server for development
To be honest, I'd forgotten about SSH FTP as it isn't something of the suite that I ever use. FTPS is the correct protocol that I use with Filezilla and with an automated script that uploads my weather data every five minutes to the Web host. - Nate -- "The optimist proclaims that we live in the best of all possible worlds. The pessimist fears this is true." Web: https://www.n0nb.us Projects: https://github.com/N0NB GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819 signature.asc Description: PGP signature
Re: web server for development
On 1/10/2020 5:52 PM, Russell L. Harris wrote: > On Fri, Jan 10, 2020 at 09:54:34AM -0500, Dan Ritter wrote: >>> ... whether rsync is an option. >> Sure, as long as you run it over ssh. The default in Debian is to >> run rsync over ssh, but it can also be explicitly invoked that way: >> rsync -av --rsh=ssh host::module /dest >> rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest >> rsync -e "ssh -l sshuser" localpath remotehost:remotepath > > For shared hosting, Hostgator offers: > > (1) SFTP (SSH FTP, port 22) > Use this one to pull and push files. > (2) FTPS (FTP over SSL or TLS, port 21) > > (3) SSH (ssh -p cpanel...@ip.add.re.ss) > Use this one to connect to the host or to execute command on the host. Simply put, sftp and ssh uses the same protocol, ssh is to execute a command remotely/connect to the host and sftp is to manage files remotely. Here the ports are differents but the protocol is the same. Don't complicate things with ftps/ftp! -- John Doe
Re: web server for development
On Fri, Jan 10, 2020 at 04:52:36PM +, Russell L. Harris wrote: > For shared hosting, Hostgator offers: > > (1) SFTP (SSH FTP, port 22) > (2) FTPS (FTP over SSL or TLS, port 21) > (3) SSH (ssh -p cpanel...@ip.add.re.ss) OK, that's quite reasonable. > Searching packages in the Debian 9 (Stretch) archive, it appears to me > that the only command-line FPT clients capable of SFTP are lftp and > ftp, but I do not know how to determine whether lftp has been compiled > with SSH capability. There's also sftp. It's in the openssh-client package. > I am familiar with SSH and with RSYNC, but I have not yet used RSYNC > over SSH. Try it, see if it works. > Also, even if I upload via RSYNC over SSL, there is need for something > similar to FTP for browsing the directory structure. What is the > solution to that need? sftp. Or any of the graphical SFTP clients if you're a Windows person. Or mounting the directory using sshfs (which is an SFTP client) and then using your local file management tools. Or just logging in with ssh and using ls, if you get a reasonable shell on the remote system.
Re: web server for development
On Fri, Jan 10, 2020 at 09:54:34AM -0500, Dan Ritter wrote: ... whether rsync is an option. Sure, as long as you run it over ssh. The default in Debian is to run rsync over ssh, but it can also be explicitly invoked that way: rsync -av --rsh=ssh host::module /dest rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest rsync -e "ssh -l sshuser" localpath remotehost:remotepath For shared hosting, Hostgator offers: (1) SFTP (SSH FTP, port 22) (2) FTPS (FTP over SSL or TLS, port 21) (3) SSH (ssh -p cpanel...@ip.add.re.ss) Searching packages in the Debian 9 (Stretch) archive, it appears to me that the only command-line FPT clients capable of SFTP are lftp and ftp, but I do not know how to determine whether lftp has been compiled with SSH capability. It appears that the only FTP package with which Hostgator support is familiar is filezilla. I am familiar with SSH and with RSYNC, but I have not yet used RSYNC over SSH. Also, even if I upload via RSYNC over SSL, there is need for something similar to FTP for browsing the directory structure. What is the solution to that need? RLH
Re: web server for development
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Greg Wooledge wrote: > On Fri, Jan 10, 2020 at 02:29:51PM -, Dan Purgert wrote: >> SFTP (SSH) has basically zero to do with RFC959 FTP; and provided that a >> target host already allows SSH logins, SFTP is quite likely already >> there. I'm actually surprised a hosting party would recommend RFC-959 >> FTP at all (SSL or no); as it requires extra work to set up (FTP servers >> usually aren't part of "base" install images, they're >> insecure-by-default and take a bit of effort to secure, and so on). > > I'm holding out hope that it wasn't really the hosting provider's > recommendation, but rather a lack of information on the part of the user, > that caused them to think FTP was the way to go. I read Nate's response as "the provider told me to use 'secure ftp'" -- as in a small (yet easily made) terminology mistake, along the lines that SSH is "secure shell" or scp is "secure copy" - so obviously 'sftp' is "secure ftp". And then when Nate went and checked it out, he found "Secure FTP" is ... well ... FTP over SSL. There's a great commentary on FTP at http://mywiki.wooledge.org/FtpMustDie [1] Helped me out a fair bit when I was still getting my feet wet with "file transfers" for servers I finally was in control of (previously having only been a user of someone else's services). [1] I'm 98% sure this was already mentioned / linked, but it can't be said enough. -BEGIN PGP SIGNATURE- iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl4YkYIACgkQjhHd8xJ5 ooEMmwgAifKnzPBHE0MT7Pc6wAGWQZhntrFmO3szsbnJiXB1XA6P6Z2zKEanwCLE kOOquBNTp3FULBMQ2NhFRfms4Oe0KTv7KHSEjUVYSgHBk/JQlw4qi89a9d7V3LL6 J6EiYHKl/iOhh9wctoDjiVog6JUs24IXedUmTeLiThqrO36Q854Z1PoydVE5OCm8 UMPBhyKnilu8MVG448fqUnahGEi/A5KT81N4uOgAn80YkhQLRGGgOdeYNGM9hC8p G0eA/Tn0CRdVOpcu4ak7lyVRfQAakFjPEXHQoGHAknoKr/buQasixG37dXUB59LQ rjdJ+ov8KRdh5TsaNyMOpJOYKegaxg== =iOpR -END PGP SIGNATURE- -- |_|O|_| |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
Re: web server for development
Russell L. Harris wrote: > > But now it seems that my first concern should be with FTP to the > server of Hostgator. And in the case of a remote shared server, I > question whether rsync is an option. Sure, as long as you run it over ssh. The default in Debian is to run rsync over ssh, but it can also be explicitly invoked that way: rsync -av --rsh=ssh host::module /dest or rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest or rsync -e "ssh -l sshuser" localpath remotehost:remotepath -dsr-
Re: web server for development
On Fri, Jan 10, 2020 at 02:29:51PM -, Dan Purgert wrote: > SFTP (SSH) has basically zero to do with RFC959 FTP; and provided that a > target host already allows SSH logins, SFTP is quite likely already > there. I'm actually surprised a hosting party would recommend RFC-959 > FTP at all (SSL or no); as it requires extra work to set up (FTP servers > usually aren't part of "base" install images, they're > insecure-by-default and take a bit of effort to secure, and so on). I'm holding out hope that it wasn't really the hosting provider's recommendation, but rather a lack of information on the part of the user, that caused them to think FTP was the way to go.
Re: web server for development
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 - -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Nate Bargmann wrote: > [...] > I would ask if their Web host supports Secure FTP, which is FTP using > SSL, AIUI. I use it for my Web Host updates, in fact it was recommended > by the host owner/operator. Hope this doesn't just muddy the waters ... :) There's a bit of a mess when it comes to file transfer protocols, and their naming, but you've got it right: "Secure FTP" is usually understood to be RFC-959 FTP over a TLS-encrypted (formerly SSL-encrypted) connection; and is usually written as "FTPS". This is not altogether different in concept to say "plain HTTP" and "secure HTTP" (i.e. "HTTPS"). "SFTP" on the other hand, typically refers to "SSH File Transfer Protocol" based on the RFC4254 "SSH Connection Protocol" (although it might rarely also refer to RFC-913 "Simple File Transfer Protocol" -- but that might've gone the way of the dodo in anything other than educational / historical contexts -- similar to say Token Ring networks, or a PDP-11, etc). SFTP (SSH) has basically zero to do with RFC959 FTP; and provided that a target host already allows SSH logins, SFTP is quite likely already there. I'm actually surprised a hosting party would recommend RFC-959 FTP at all (SSL or no); as it requires extra work to set up (FTP servers usually aren't part of "base" install images, they're insecure-by-default and take a bit of effort to secure, and so on). - -BEGIN PGP SIGNATURE- iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl4Yik8ACgkQjhHd8xJ5 ooHv7Qf+PfqILFiaB5JuvYg1uLdnvAfZc45eAMN21cR6gF3AtI2kJP5/8c78xhrr mXZmz0PPu5Tr7nQxamZoSvtLGEgszr3S0FBftwyyt4dAPJo6a4RAWAFw0/qwp+h8 tjsP04b2vpLEzBUC1QoormDzfH3h3IhuPi/X27rr/jO+UrnfXkegJ9swT+KqNZKi 90x83IYQTS2fBN4uJANwpCBUVJWA0uSKGNvH8+8VtIdVWUXPqVL4Ji7Po1GJGKBu Kp5YoAztaz6OVB8NUeKrTxLY7ox/3aQcvvbSK2vIRGjxR/St45Ys28pw+qHPb1QU 8nPtjQQHp91igCM2yc/BPorSmY3XYw== =Xxvm - -END PGP SIGNATURE- -BEGIN PGP SIGNATURE- iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl4YiloACgkQjhHd8xJ5 ooEQCAf9Gtjg1fx2WPaxB1rv71lRxP2P6rPs03GjZfFbDzhSDBbJpbTEw0C5oLBm yvAE2XMSj2St2twQ34741s4FP8e2BDW75Zjz8y22IYPWmDsmBlhH7BpWIJTg6E7R SoCsdzVuZkPIkmvU+n+T5YfhIv5C7haI/gykOKROKOmkHwtCtzK2w1MuY1FiV5bD 3U0FxlOMFbU0FZiA58KvnhYiI8H0tYZIDaydf5hJAkdc2NnH925KXpojQiM4UpzY Vl6OGXylkP6aDrBUw96jdc2/LLUqXZuuw2w4TvX8czTAIN6k4iZlD8isz2xzM7LO 3SRoObYaMqSkil6KYJmhDGh8xtjoXA== =qYsC -END PGP SIGNATURE- -- |_|O|_| |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
Re: web server for development
On Thu, Jan 09, 2020 at 06:22:00PM -0600, Nate Bargmann wrote: > * On 2020 09 Jan 14:29 -0600, Russell L. Harris wrote: > > But now it seems that my first concern should be with FTP to the > > server of Hostgator. And in the case of a remote shared server, I > > question whether rsync is an option. > > I would ask if their Web host supports Secure FTP, which is FTP using > SSL, AIUI. I use it for my Web Host updates, in fact it was recommended > by the host owner/operator. If that works for you, hey, cool. But that sounds some sort of ugly hack to try to continue using old FTP software, not a real step forward. SFTP is a completely separate protocol that has nothing to do with FTP. It isn't FTP wrapped in SSL. It's typically part of SSH, so if you have SSH access to your host, you'll almost certainly have SFTP as well. (Some providers may give you SFTP without SSH, though.) If the regular rsync-over-ssh solution doesn't work with your provider, but you have SFTP access, then you can mount the provider's directory using sshfs (which uses SFTP). Then you can just rsync to the mounted directory "locally".
Re: web server for development
* On 2020 09 Jan 14:29 -0600, Russell L. Harris wrote: > But now it seems that my first concern should be with FTP to the > server of Hostgator. And in the case of a remote shared server, I > question whether rsync is an option. I would ask if their Web host supports Secure FTP, which is FTP using SSL, AIUI. I use it for my Web Host updates, in fact it was recommended by the host owner/operator. - Nate -- "The optimist proclaims that we live in the best of all possible worlds. The pessimist fears this is true." Web: https://www.n0nb.us Projects: https://github.com/N0NB GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819 signature.asc Description: PGP signature
Re: web server for development
In this message, I respond to several suggestions: On Thu, Jan 09, 2020 at 08:37:12AM -0500, Greg Wooledge & others wrote: One way would be: https://httpd.apache.org/docs/2.4/mod/mod_userdir.html I thank you for the link. More as an alternative to apache on an another host: - using the built-in webserver in 'hugo' - Python http.server Thanks; I forgot about those. My aspirations are for a simple static web site, and I looked at hugo, jekyll, pelican, and other generators; but I did not find one which suits my primary need, which is to work hand-in-hand with LaTeX markup. But that is a separate matter... Do your pages use any server side facilities like PHP or server side includes? If not, and your pages have purely static content, you can just view your pages as plain files on your local machine, no need for a web server. I understand; that would work. But I have a computer sitting unused, and this gives me an excuse to install and get familiar with Buster before switching this, my main machine, from Stretch to Buster. Step one: stop using FTP. Step two: SERIOUSLY. STOP USING FTP. Step three: I REALLY REALLY MEAN IT. IF YOU KEEP USING FTP, WE'RE DONE. You have my attention; I am all ears. But I do have a web hosting account with Hostgator which provides shared hosting; and I am not aware of a mechanism other than FTP to get web content from here to that remote server. That being the case, I had no concern with using FTP within the confines of my LAN, which is comprised of two computers, together with a firewall (ipFire). Approach one: You could just install apache2 on the development machine. There's really no need to transfer the content to a second host, just to bounce it back to the original host via HTTP. Point the apache configs at wherever your in-development content resides. I currently am doing that. (For this approach and for all the other approaches, it doesn't *have* to be apache2. You could use nginx, or lighttpd, or any other web server.) I understand. Approach two: You could configure the web server on the second machine to serve your content via a virtual host that's rooted somewhere other than /var/www/html. Then rsync your content to that location, using whatever user account you've configured to have write access to that location. This, I think, is the approach suggested by the first response. Approach three: You could give your user account ownership of, or group write access to, /var/www/html on the second machine and rsync your content there, if you are not using virtual hosts for some reason. This is my first encounter with the term "virtual host"; but my first inclination was to change ownership of /var/www/html, or to make use of groups. But now it seems that my first concern should be with FTP to the server of Hostgator. And in the case of a remote shared server, I question whether rsync is an option. RLH
Re: web server for development
On Thu, Jan 09, 2020 at 01:40:49PM -0500, Dan Ritter wrote: Greg Wooledge wrote: If a web/storage provider doesn't offer at *least* SFTP access in 2020, it's time to find a new provider. https://www.hostgator.com/help/article/secure-ftp-sftp-and-ftps TL;DR: they support SFTP, which is appropriate. I was using FTP in the generic sense. In the past I have used the Debian packages lftp and vsftp, but thanks for the exhortation to use the SFTP protocol. RLH
Re: web server for development
Greg Wooledge wrote: > On Thu, Jan 09, 2020 at 06:29:57PM +, Russell L. Harris wrote: > > But I do have a web hosting account with Hostgator which provides > > shared hosting; and I am not aware of a mechanism other than FTP to > > get web content from here to that remote server. > > If a web/storage provider doesn't offer at *least* SFTP access in 2020, > it's time to find a new provider. https://www.hostgator.com/help/article/secure-ftp-sftp-and-ftps TL;DR: they support SFTP, which is appropriate. -dsr-
Re: web server for development
On Thu, Jan 09, 2020 at 06:29:57PM +, Russell L. Harris wrote: > But I do have a web hosting account with Hostgator which provides > shared hosting; and I am not aware of a mechanism other than FTP to > get web content from here to that remote server. If a web/storage provider doesn't offer at *least* SFTP access in 2020, it's time to find a new provider.
Re: web server for development
On Thu, Jan 09, 2020 at 06:16:51AM +, Russell L. Harris wrote: > For development of a web pages, I installed Apache2 on another machine > in the LAN so that I can FTP web pages from the development machine to > the web server and view the pages from the development machine. > > But the installation of Apache2 on Buster serves documents from > /var/www/html/, which is owned by root, so as a normal user I cannot > FTP into that directory. > > The web server is not exposed outside the LAN, so security is not an > issue. > > What is the proper approach? There is no single "proper" approach. There are many approaches that will work. However, there are some steps you have to take first. Step one: stop using FTP. Step two: SERIOUSLY. STOP USING FTP. Step three: I REALLY REALLY MEAN IT. IF YOU KEEP USING FTP, WE'RE DONE. Approach one: You could just install apache2 on the development machine. There's really no need to transfer the content to a second host, just to bounce it back to the original host via HTTP. Point the apache configs at wherever your in-development content resides. (For this approach and for all the other approaches, it doesn't *have* to be apache2. You could use nginx, or lighttpd, or any other web server.) Approach two: You could configure the web server on the second machine to serve your content via a virtual host that's rooted somewhere other than /var/www/html. Then rsync your content to that location, using whatever user account you've configured to have write access to that location. Approach three: You could give your user account ownership of, or group write access to, /var/www/html on the second machine and rsync your content there, if you are not using virtual hosts for some reason.
Re: web server for development
On Thu, 2020-01-09 at 06:16 +, Russell L. Harris wrote: > For development of a web pages, I installed Apache2 on another machine > in the LAN so that I can FTP web pages from the development machine to > the web server and view the pages from the development machine. Do your pages use any server side facilities like PHP or server side includes? If not, and your pages have purely static content, you can just view your pages as plain files on your local machine, no need for a web server. -- Tixy
Re: web server for development
On 1/9/2020 7:16 AM, Russell L. Harris wrote: > For development of a web pages, I installed Apache2 on another machine > in the LAN so that I can FTP web pages from the development machine to > the web server and view the pages from the development machine. > > But the installation of Apache2 on Buster serves documents from > /var/www/html/, which is owned by root, so as a normal user I cannot > FTP into that directory. > > The web server is not exposed outside the LAN, so security is not an > issue. > > What is the proper approach? > One way would be: https://httpd.apache.org/docs/2.4/mod/mod_userdir.html More as an alternative to apache on an hother host: - using the built-in webserver in 'hugo' - Python http.server -- John Doe
web server for development
For development of a web pages, I installed Apache2 on another machine in the LAN so that I can FTP web pages from the development machine to the web server and view the pages from the development machine. But the installation of Apache2 on Buster serves documents from /var/www/html/, which is owned by root, so as a normal user I cannot FTP into that directory. The web server is not exposed outside the LAN, so security is not an issue. What is the proper approach?