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
    vs code with code snippets
    Making The Most Of VS Code With Code Snippets
    Aug 29, 2022
    animation
    Adding Animation To Your Application The Angular Way
    Sep 19, 2022

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

    Categories
    • Software Development
    • Web Development
    Tags
    • linux
    • nginx
    • server
    • ssh
    ubuntu
    ubuntu

    We’ve made changes on the staging branch, please redeploy it.

    You’ve been SSHing into Linux terminals for a little while now, and you’re getting more responsibility. The latest ‘just quickly do this on the staging box’ request has come in, and it is again your time to shine. Your team uses NGiNX for their web servers, and the front-end application your team has been working on was written using VueJS. Let’s learn how to figure out what needs to be done where, and then do it.

    First things first, we know we’re using NGiNX, so we’ll see what sites we have available that are being served using NGiNX. NGiNX saves the server configurations for sites in the /etc/nginx/sites-available folder on your file system. By using the ls command we can see which sites have config files available for them. ls -la /etc/nginx/sites-available returns a result called yoursite.yourcompany.com. It is safe to assume this is the configuration for serving your site on the staging server.

    If we cat the contents of that config you will see a line that says something along the lines of root /home/user/sitename/dist inside one of the server blocks. The root keyword is telling NGiNX where the files that the webserver needs to serve are located. By changing directory and going to that location on our filesystem we can learn a little more. cd /home/user/sitename will take us into the folder containing the dist that is being served using NGiNX.

    If we list the contents of this directory (ls -la) and we see that the directory contains a .git hidden folder we know that the site can be rebuilt on the correct branch directly from this location. git pull followed by a git checkout staging will pull all the code changes and move our HEAD to the correct branch. When we’re on the correct branch we can rebuild the dist folder to serve our latest changes. We need to first install any new packages included in the commit npm i. Once the packages have been installed, we can build the new dist, by default for VueJS this is npm run build.

    After the build process is complete, we can check that the dist was altered by looking at the details of files and folders in our current directory and seeing that the dates are changes on the dist folder. To finish off the deploy process we will have to restart the NGiNX service. You will likely need a password to run the command using sudo. First, we can check that our NGiNX configs are still fine by running nginx -t. Once we have done that running sudo service nginx restart will restart the webserver and serve the new dist we have created. We can refresh our staging website page on the internet and look for the changes that were made.

    What do we do if we are given the new dist folder, and we don’t have to build it ourselves? In the terminal on our own computer, we can copy the new dist across using the scp command, or we could use something like Filezilla or Win SCP to get the new dist into the remote machine in the directory we need it. Once there we will just have to run the sudo service nginx restart command to complete our task.

    Contact us


      Related posts:

      ubuntuHelp! I’ve Had To SSH Into A Linux Box (Part 2) ubuntuHelp! I’ve Had To SSH Into A Linux Box And Don’t Know What To Do rules for ux designersRules For UX Designers what's new in vueWhat’s New In Vue
      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 4 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