switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    development team
    The Weird And Beautiful JavaScript Language
    Jun 7, 2022
    imposter syndrome
    Imposter Syndrome
    Jun 20, 2022

    Help! I’ve Had To SSH Into A Linux Box (Part 2)

    ubuntu
    ubuntu

    Now that you’re in your ssh session and know how to navigate the filesystem, can view the contents of folders, and can check the manual for built-in Linux apps it’s time to do some actual work. We’re here to troubleshoot some errors that we’re experiencing on our webserver. In this example we’re using NGINX and an Apache Tomcat server.

    The default directories for these apps are /etc/nginx and /opt/tomcat. Our webserver keeps displaying a 500 internal error when we look at our network console, let’s see how we can check out if NGINX has any ideas what’s going wrong. While you may intuit that the NGINX log files should be in /etc/nginx/logs or something similar you’ll find that they actually exist in /var/log/nginx. Most logs are, perhaps unsurprisingly, found in the /var/log directory.

    Armed with your knowledge from the previous blog post you confidently navigate to the NGINX logs. cd /var/log/nginx. No errors, the path you see is correct, let’s see what’s in the folder. ls -l you enter to see a massive wall of different log files. I’ll let you in on a little secret, the one we’re looking for is called ‘error.log’.

    OK – we’ve located the file, we didn’t believe we’d get this far but here we are. Now what? The last blog post said nothing about this, I can just move around and see what’s in my folders. How do I now see what’s in the actual file? There are a few ways you could accomplish this. Firstly, you could open the file in a shell-based text editor live Vim, Emacs, or Nano. These will likely already be installed on the machine already. To open the error.log file you would simply type vim error.log.

    It’s taking a while to load… We’ve run ls -l previously so we can have a look at how big the error.log file is. For big log files it’s not a good idea to load the entire contents into a text editor. Our file is big, so we’re going to approach checking it out in a different way. Using the tail command we can see the last lines of the file. tail error.log we input, confident that we’ll get a result.

    We have a result, but it’s only the last 10 lines of the file, and they’re all part of a stack trace. Not very useful. By using the man we can find some flags to add to the tail program. We’ve found that using -n will allow us to select how many lines from the bottom of the file we want to see. We enter tail -n 100 error.log. Fortunately, in this example it gives us enough information to show a senior dev so they can fix the problem.


    Read Help! I’ve Had To SSH Into A Linux Box For The First Time (Part 3).

    Contact us


      Related posts:

      laravel envoyer and forgeProvisioning A New Digital Ocean Server With Laravel Forge, And Deploying Code With Laravel Envoyer easily view your laravel logs using laravel log viewerEasily View Your Laravel Logs Using Laravel Log Viewer ubuntuHelp! I’ve Had To SSH Into A Linux Box And Don’t Know What To Do ubuntuHelp! I’ve Had To SSH Into A Linux Box For The First Time (Part 3)
      Share
      0
      Nicholas Driver
      Nicholas Driver
      Nicholas is a chemistry graduate who has worked previously as a project manager, managing director, and caregiver, but not as a chemist. After moving into software engineering in 2018 he has worked on big data, business intelligence, and various full-stack projects in a variety of different languages, platforms and frameworks.

      Leave a Reply Cancel reply

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

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165


      switchon@lavalamp.biz


      Unit 1 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      nbconnect msp
      nbclearning
      river broadband
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy