CentOS Linux Web Server ssh Restart Primer Tutorial

CentOS Linux Web Server ssh Restart Primer Tutorial

CentOS Linux Web Server ssh Restart Primer Tutorial

Are you managing a CentOS (ie. Linux) Apache/PHP/MySql web server via cPanel (via WHM, for example) and ssh (via macOS Terminal application, for example) and sftp (via FileZilla, for example)? Additional to the restarting of processes involved in managing such a web server as outlined through the thread of procedures mentioned in the blog postings of CentOS Linux Web Server Crontab Restart Primer Tutorial we left out one.

This “ssh restart” can be achieved via …

  • cPanel … if the reason is that there is an error message like …

    Connection closed by remote host

    … that you get at the command line while trying to access ssh (in the first place) via a command like …

    ssh -p 22 [username]@[web-server-ip-address]

    … and which we present, today, a view of resolving via today’s “guest” animated GIF …you can call High Plains GIFter … if you’re game?!
  • command line … ie. you succeed with “ssh -p 22 [username]@[web-server-ip-address]” and are at the web server wanting to reset ssh service via (for CentOS) …

    service sshd restart

… and, as you might imagine, it is that first scenario you’re going to encounter more often. It is one of those scenarios that might fix itself up over time, but that an “ssh restart” is extremely unlikely to be troublesome, as well as speeding up the “righting process” considerably.

What causes this scenario? Read on, MacDuff.


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

CentOS Linux Web Server Crontab Restart Primer Tutorial

CentOS Linux Web Server Crontab Restart Primer Tutorial

Just as “mindfulness” can be a wakeup call to us, when something unusual happens, it can be a great time to learn, but, alas, it can be like being “thrown in at the deep end”. I’d like my time over regarding the scenario presented with the recent CentOS Linux Web Server Services Restart Primer Tutorial tutorial and our need to restart services on our CentOS Linux (WHM and cPanel) Apache/PHP/MySQL web server here at the rjmprogramming.com.au domain.

We thought, in our optimistic way, but deep down were troubled, that everything was hunky-dory regarding the web server’s functionality, after those first “ssh” round of restarts. It was running both Apache and MySQL fine by the looks. Things were getting done, but the signs were there to look deeper. For instance, the next day, to get the Landing Page here at RJM Programming to link to the latest WordPress Blog Landing Page blog posting, as it is designed to do, we had to use (good ol’) “ssh” (again) to run those processes. The optimist thinks this might all be a Dallas moment but perhaps it would have been better to be a realist, because, lo and behold, the next day, the same processes had to be run again to make everything hunky-dory.

You’ll know if you’ve read this blog before how intrinsically linked are RJM Programming’s Landing Page‘s top left HTML iframe (for you users with fast reactions, that is) and Crontab and Curl techniques up at the web server which you can read more about the history of at Landing Page Mobile Phone Crontab Curl Tutorial … put two and two together … spell it wrong … and you get … … a short frilly skirt … but we digress … … and you get that Crontab mustn’t be running. That’s doubly odd, adding on to the “odd” of the tutorial below and you get 2x x 2x (-1 … to make it odd … then +1 to justify the comment to follow) … … spell it wrong … and you get … … a short skirt … but we digress … … oddness. Which begs the question “how can you tell if Crontab is running or not? Gooooooggggggllllleeeee … try this query to get us onto advice whereby we go ‘/etc/init.d/crond status’ only to find out why we get ‘crond dead but pid file exists’ error message here … and so onto the remedy to the situation, as you can see being played out with today’s tutorial picture.


/etc/init.d/crond stop
/etc/init.d/crond status
crond dead but pid file exists
/etc/init.d/crond start
Starting crond:
/etc/init.d/crond status
crond (pid xxxx) is running...

And now things are much more hunky-dory … “John Dory” … for those with an open mouth gobsmacked by this discovery!


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.


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

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

One Response to CentOS Linux Web Server ssh Restart Primer Tutorial

  1. I do not even know how I stopped up right here, however I
    believed this publish was once great. I do not realize who you are however certainly you’re going to a well-known blogger in case you
    are not already. Cheers!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>