Server unexpectedly closed network connection FileZilla Tutorial

Server unexpectedly closed network connection FileZilla Tutorial

Server unexpectedly closed network connection FileZilla Tutorial

In day to day web server management (of the CentOS (Linux) WHM/cPanel Apache/PHP/MySql rjmprogramming.com.au domain) we find the most baffling error that you occasionally come up against “web server access wise” is FileZilla’s (or any sftp application’s) error message …


Server unexpectedly closed network connection

… which can happen when you rapidly do too many connections “sftp”ing away, and some of them “trip up”. Now, let me tell you now, you can fiddle with timeout settings, but it is one of those issues where it feels like Goldilocks and the Three Bears about these settings, so, instead, we recently came upon a better set of steps to resolve this problem, which can also “infect” ssh’s …


ssh -p 22 username@xx.xx.xx.xxx

… on Linux … where you might have “stuffed it up” to get responses like …


ssh_exchange_identification: Connection closed by remote host

… and/or …


ssh_exchange_identification: read: Connection reset by peer

Okay, so “the better solution” we got to followed advice from this excellent link, thanks, where it says to try …

https://<SERVER-IP>/scripts2/doautofixer?autofix=safesshrestart

… and that https://<SERVER-IP>/ represents your URL for access to cPanel (for the case of our CentOS (Linux) WHM/cPanel Apache/PHP/MySql) on our web server, of the form https://xx.xx.xx.xxx:cPanelPortNumber (where “xx.xx.xx.xxx” is the IP address of the rjmprogramming.com.au domain).

This action above on a web browser gave us the dialog on the left of today’s tutorial picture, where you can read that port 22 (used for both sftp and ssh access, by default) was still being used … have read that this problem can “temporarily” (didn’t wait long enough myself, though did wait an hour) cause a hosts.deny file on your web server to blacklist your access … and that to help out they would set up port 23 as an alternative ssh access port. This was great, because then, at the MacBook Pro Mac OS X Terminal application’s command line we could then type in …


ssh -p 23 username@xx.xx.xx.xxx

… where “xx.xx.xx.xxx” is the IP address of the rjmprogramming.com.au domain … and also you could use a port 23 FileZilla sftp connection at this time, too, if you’d like … and then once logged back onto the web server … yay!!!! … we can start normal access (on port 22), totally, again via


service sshd restart

… in that expected CentOS pattern of ssh maintenance that we saw play out so much when we presented CentOS Linux Web Server Services Restart Primer Tutorial as shown below. Please do not go “service sshd stop” then “service sshd start” because you’ll be stuck at “then” with no ssh session! All systems go for FileZilla port 22 sftp access and ssh port 22 access. Happy days indeed! While we are here, suppose it hadn’t worked? Probably our next move may have been to use cPanel (via WHM) “Graceful Server Reboot”, and if that didn’t work, perhaps a “Power Management” reboot. Before all this, tried cPanel restarts of DNS and FTP and Exim, to no avail.

So, before we go, let’s compare these two CentOS (Linux) WHM/cPanel Apache/PHP/MySql access issues …

CentOS (Linux) WHM/cPanel Apache/PHP/MySql access issue (ignoring untested “Power Management”)
FileZilla sftp Symptom(s) ssh Symptom(s) ssh working?,sftp (via FileZilla)?,cPanel (via WHM)? Remedy (web browser, Terminal, ssh)
The fact that FileZilla sftp or ssh is not working while cPanel is The fact that cPanel is working and FileZilla sftp or ssh is not working Yes,No,No service httpd restart
service mysqld restart
service cpanel restart
Server unexpectedly closed network connection Connection closed by remote host
read: Connection reset by peer
No,No,Yes https://<SERVER-IP>/scripts2/doautofixer?autofix=safesshrestart
ssh -p 23 username@xx.xx.xx.xxx
service sshd restart

Previous relevant CentOS Linux Web Server Services Restart Primer Tutorial is shown below.

CentOS Linux Web Server Services Restart Primer Tutorial

CentOS Linux Web Server Services Restart Primer Tutorial

The other day the unthinkable happened, for us. Something to do with Linux and its associated role in running the rjmprogramming.com.au web server failed, not totally, but in a way I’d never before encountered using Linux or Unix. You see Linux and Unix are very stable. They just go about doing stuff running web servers well, except where “human error” plays a part, and include here any thoughts about lack of resources occurring because of lack of foresight by humans.

Anyway, be that as it may, we are not here, today, to talk about the causes of this issue … that’s very much Nala and Luna’s domainkennel … but more “picking up the pieces”, as fast as possible.

You might recall from Windows FTPManager Ftp Client Primer Tutorial us basically discussing “access” with our CentOS (WHS) (with cPanel) Apache/PHP/MySQL Linux web server for the rjmprogramming.com.au domain’s access …

  • cPanel … for monitoring and process control purposes … web application
  • power management … for rebooting purposes … web application
  • ssh … for logging on for tasks such as crontab maintenance … desktop (command line) application
  • sftp (or ftp) … for the day to day transfer of files to and from the web server to clients … Mac OS X and Windows … can be desktop or web application such as FireFTP (for Firefox web browser)

… well, not including our really last resort of “Power Management” we had, for a short period of time recently a situation where “cPanel” was down and “sftp” could not help with the type of access we were after, which was a report that cPanel normally provides. Would like to reiterate. Apart from occasional DNS self-restricting temporary arrangements, cPanel never fails this way. So it did take 3 “dumb” goes at it to believe the unbelievable (for us), and deal with realities.

Those realities were that “ssh”, which was still working, was needed to bring “services” back up. However, we were quite rusty (especially regarding the cPanel one below) about this (as it is so easy in day to day use to use cPanel’s “Restart” menu options), so consulted Goooooogggggllleeee and its linkages (thanks everybody, especially the forever reliable Stack Overflow website, a resource hard to imagine surviving without) to …

  • this Apache restart via this style of Google query got us onto …

    service httpd restart

    … to restart URLs (that all need Apache (httpd)) that do not need MySQL such as the RJM Programming Landing Page, but not webpages requiring MySQL such as webpages like you are reading now at our RJM Programming WordPress Blog Landing Page where, during this “down time” the error message would have been (and we saw at the time) … “Error establishing a database connection” … so …
  • this HowTo SSH Restart Mysql Server on a Linux and Unix Command Line via this style of Google query got us onto …

    service mysqld restart

    … to restart URLs that do need MySQL such as the RJM Programming WordPress Blog Landing Page where, all being well, you get rid of “Error establishing a database connection” error message by this “ssh” web server access restarting of these (essential) Apache and (perhaps essential) MySQL services, but what of “cPanel” which is not reinstated just by restarting these two CentOS Linux Apache/PHP/MySQL services … well, please read on …
  • this What is the command to restart cpanel via the command line? via this style of Google query got us onto …

    service cpanel restart

    … resurrecting all that great cPanel web server management functionalities for an Apache/PHP/MySQL web server

… to get the gist that there is a useful pattern here … thanks CentOS … that goes, for “ssh” access leading to a superuser login command line environment you restart the immediately required web server CentOS services via …


service [serviceName] restart

Ah, back to normal … so in the spirit of not wanting to scare the pants off any web server managers out there immediate danger averted?!


Previous relevant Windows FTPManager Ftp Client Primer Tutorial is shown below.

Windows FTPManager Ftp Client Primer Tutorial

Windows FTPManager Ftp Client Primer Tutorial

We are always on the lookout for good tools to do with the fundamentals of Web Server maintenance. Our view of what are the essentials for the maintenance of an Apache/PHP/MySql web server (like for the rjmprogramming.com.au domain) are …

  • cPanel … for monitoring and process control purposes … web application
  • power management … for rebooting purposes … web application
  • ssh … for logging on for tasks such as crontab maintenance … desktop (command line) application
  • sftp (or ftp) … for the day to day transfer of files to and from the web server to clients … Mac OS X and Windows … can be desktop or web application such as FireFTP (for Firefox web browser)

… and today we look at a product new to us, that we became aware of recently, facilitating the last of those … sftp (or ftp) … involving a Windows local client and web server remote computer to transfer files to and from.

The Windows desktop product new to us, that seems really very good, and you should consult regarding the early slides of our slideshow today, to see for yourself, is called FTPManager Lite by Deskshare Incorporated.

And so, with today’s slideshow …

  • the early slides were done off a Macbook Pro to suss out the product, the slides of which were transferred to our web server by the FileZilla sftp (or ftp) client (which we’ve discussed previously with FileZilla Secure ftp Primer Tutorial as shown below) … and …
  • the latter slides were done off a Windows PC to install and use the product, the slides of which were transferred to our web server by the FTPManager ftp (or sftp) Client

We found FTPManager to be very easy to use and navigate immediately, just what you want for an FTP Client, and if you see good slides in the slideshow today you can thank FTPManager for it … thanks.

Guess this begs the question regarding what takes up most time maintaining an Apache/PHP/MySql web server, for us? In order of use, with highest amount of use up the top, it would be …

  • sftp (or ftp) … for the day to day transfer of files to and from the web server to clients … Mac OS X and Windows
  • cPanel … for monitoring, some installations, some builds and process control purposes
  • ssh … for logging on for tasks such as crontab maintenance
  • power management … for rebooting purposes

… and so that may show you how important products such as FTPManager are to those maintainers of web servers. Most likely, though, these products get hammered with use, but achieve quietly and efficiently, without fanfare, for the vast majority of us.

By the way, those role descriptions cross over quite a bit, For example …

  • sftp or ftp client can handle file permissions which you may have considered doing using ssh
  • cPanel can reboot the web server if available, in place of power management
  • ssh can monitor many of the things cPanel can monitor, but perhaps in not such a cute presentation, and can probably host an sftp or ftp session (the other way around) also (with a less cute presentation), and can be used to reboot the web server too … can do the lot, as you’d expect, because a web server is a Linux or Unix or Windows (or some other kind of) “box” (basically) … “box” = computer

Previous relevant FileZilla Secure ftp Primer Tutorial is shown below.

FileZilla Secure ftp Primer Tutorial

FileZilla Secure ftp Primer Tutorial

When you maintain a Web Server there is often a requirement to upload (from your local disk) to the web server and download (from the web server) files you are working on?

We discussed this previously with Web Server Access Primer Tutorial as shown below.

We think the Firefox web browser addon called FireFTP mentioned in Firefox and Favourite Plugins Tutorial is pretty much the “bees’ knees”.

Today we look into an alternative Open Source product called FileZilla which may fit the bill as well, and it sits separate to any web browser as a desktop GUI application for Windows or Mac. Today we show an install on Windows for the server and client products, the latter of which you’ll use to upload local files via the (s)ftp protocol.

Of course if your web hosting came with other specific arrangements for uploading, that would be a better course of action to invoke.

FileZilla is a pretty friendly and useful tool, but, as we are in the Firefox web browser so often it is hard to resist using FireFTP. Hope you enjoy today’s tutorial … and what could follow?


Previous relevant Web Server Access Primer Tutorial is shown below.

Web Server Access Primer Tutorial

Web Server Access Primer Tutorial

When you maintain a Web Server there are lots of tools of use, but just what do you need to run an Apache/PHP/MySql web server?

  • + + @ +
  • sftp or ftp (pretty much essential) … s stands for “Secure” as in “Secure Shell”
  • ssh or telnet (practically very important)… s stands for “Secure” as in “Secure Shell”
  • cPanel (good to have … lots of times is essential) … also see Web Server Primer Tutorial
  • phpMyAdmin (if using MySql … comes with cPanel quite often … practically essential if you use PHP/MySql)… also see Web Server Primer Tutorial

With today’s tutorial we show access via a Mac laptop’s Terminal application’s Linux bash session’s access to the web server domain at www.rjmprogramming.com.au using ssh (which is a “logging on” piece of functionality … also see rlogin). This destination CentOS web server environment is also Linux. Also in the picture is a bit showing sftp being used for the transfer of files to and from the web server via your laptop, and we use Firefox plugin FireFTP to facilitate this. There is a Firefox and Favourite Plugins Tutorial regarding this below as well.

Here are some good researching links … so, bye for now …


Previous relevant Firefox and Favourite Plugins Tutorial is shown below.

Firefox and Favourite Plugins Tutorial

Firefox and Favourite Plugins Tutorial

Tutorial

Transcript:

One of the best tools for Web Development is an HTML element analyzer.

There are a few out there by now, but I really like Firebug from HTTP://getfirebug.com/

Both these great tools are plugins for my favourite Web browser Firefox from
HTTP://www.mozilla.org/en-US/firefox/new/

Another important tool for Web Development is an ftp application like FireFTP from
HTTP://fireftp.net/

So let’s have a look at Firefox, briefly, and Firebug and FireFTP …

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Networking, Operating System, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

2 Responses to Server unexpectedly closed network connection FileZilla Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *