• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Rudimentary Shell Script (Done) - SVN Update for CentOS 6.7

Scheduled Pinned Locked Moved
General
4
10
3.5k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    ttrammell
    last edited by ttrammell Sep 28, 2016, 9:43 AM Aug 12, 2016, 2:03 PM

    It ain’t pretty, but I am getting a little flustered and having to constantly do all that typing to update FOG, regardless if I am just using a small call portion or not.

    I have tested this, and yes, it is VERY rudimentary and is currently usable.
    Automated - always up to date - script

    #!/bin/bash
    
    # Enter root and uninstall php-common to install FOG
    yum -y remove php-common
    
    # Update FOG to the latest SVN version (Can be replaced with GIT, I assume)
    cd /root/fogproject # Change this to your fog directory
    svn up # Can be replaced with <git pull>?
    cd bin
    ./installfog.sh -y # Requires no input (Thanks, Wayne)
    
    # Reinstall php-common so that you can actually load the FOG page with the proper PHP version (5.6)
    yum -y remove php-common
    yum -y update
    yum -y install epel-release
    wget https://dl.fedoraproject.org/pub/epel-release-latest-6.noarch.rpm
    wget https://centos6.iuscommunity.org/ius-release.rpm
    rpm -Uvh ius-release*.rpm
    yum -y update
    yum -y install php56u php56u-common php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath
    
    # Configure PHP Options using Stream EDitor
    # php.ini default location = /etc/php.ini
    # Change the last part of the meta-data to the value you want and change your file directory to match the correct file
    sed -i 's/date.timezone =.*/date.timezone = Chicago\/America/' /etc/php.ini # Change this to meet your settings
    sed -i 's/memory_limit =.*/memory_limit = 2G/' /etc/php.ini # Change this to meet your settings
    sed -i 's/always_populate_raw_post_data =.*/always_populate_raw_post_data = Off/' /etc/php.ini # Change this to meet your settings
    sed -i 's/asp_tags =.*/asp_tags = Off/' /etc/php.ini # Change this to meet your settings
    
    # Restart Apache Service
    service httpd restart
    

    Make sure that your values are changed to what you need, and that you are changing the correct file. Values are within the last part of the sed string, in the metadata section: 's/entry =.*/replaced_entry = <value>/' <php.ini>

    If you need to add in special characters in your strings such as / you can set it like Chicago\/America and it will look like Chicago/America on your edited file - for those that are unfamiliar with sed.

    References:
    FOG Setup: https://wiki.fogproject.org/wiki/index.php?title=Upgrade_to_trunk
    PHP Setup for CentOS: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html#instgde-prereq-php55-install-centos
    sed assistance: http://stackoverflow.com/questions/16790793/how-to-replace-strings-containing-slashes-with-sed , http://stackoverflow.com/questions/8822097/how-to-replace-whole-line-with-sed , http://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files

    Yes, I really did just ask that question and I am only /slightly/ ashamed of it.

    W 1 Reply Last reply Aug 13, 2016, 12:09 AM Reply Quote 0
    • Q
      Quazz Moderator
      last edited by Aug 12, 2016, 2:37 PM

      Why are you installing PHP5.5 if I might ask?

      T 1 Reply Last reply Aug 12, 2016, 2:54 PM Reply Quote 0
      • T
        ttrammell @Quazz
        last edited by Aug 12, 2016, 2:54 PM

        @Quazz Recently, when I have been installing FOG it has only ever put on PHP 5.3, so – minimally – I’m installing 5.5 manually.

        I have to uninstall php-common everytime I want to update FOG, whether that is a problem officially or just something on my side, I am not sure.

        Yes, I really did just ask that question and I am only /slightly/ ashamed of it.

        Q 1 Reply Last reply Aug 12, 2016, 2:57 PM Reply Quote 0
        • Q
          Quazz Moderator @ttrammell
          last edited by Quazz Aug 12, 2016, 8:57 AM Aug 12, 2016, 2:57 PM

          @ttrammell Ah, I guess php5.3 is the latest available for centos 6.7 by default yum repositories then?

          T 1 Reply Last reply Aug 12, 2016, 3:00 PM Reply Quote 0
          • T
            ttrammell @Quazz
            last edited by Aug 12, 2016, 3:00 PM

            @Quazz Your guess would be as good as mine, but that makes some sense since yum update could never find updates for PHP without those special repositories (fedoraproject / iuscommunity).

            Yes, I really did just ask that question and I am only /slightly/ ashamed of it.

            1 Reply Last reply Reply Quote 0
            • W
              Wayne Workman @ttrammell
              last edited by Wayne Workman Aug 12, 2016, 6:15 PM Aug 13, 2016, 12:09 AM

              @ttrammell

              ./installfog.sh # Requires Input
              

              can be replaced with

              ./installfog.sh -y # Does not require input.
              

              And if you move to CentOS 7, you can go to PHP 7.

              And, if you wish to stay on CentOS 6, you can replace that line with

              php_ver='5.5' php_verAdds='55u' ./installfog.sh -y
              

              Or, simply update your packages list inside of /opt/fog/.fogsettings with the ones you want to use, and also update php_verAdds and php_ver while you’re in there too.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
              Daily Clean Installation Results:
              https://fogtesting.fogproject.us/
              FOG Reporting:
              https://fog-external-reporting-results.fogproject.us/

              T 1 Reply Last reply Aug 15, 2016, 6:25 PM Reply Quote 1
              • N
                nancylopar
                last edited by Aug 13, 2016, 7:07 PM

                thanks for these scripts, they are very helpful 🙂

                1 Reply Last reply Reply Quote 0
                • T
                  ttrammell @Wayne Workman
                  last edited by Aug 15, 2016, 6:25 PM

                  @Wayne-Workman Sadly, running php_ver='5.5' php_verAdds='55u' ./installfog.sh -y– at the very least without having any other version of php running, it does not work (for me).

                  Will take a look at editing package listings later.

                  Yes, I really did just ask that question and I am only /slightly/ ashamed of it.

                  W 1 Reply Last reply Aug 15, 2016, 6:34 PM Reply Quote 0
                  • W
                    Wayne Workman @ttrammell
                    last edited by Aug 15, 2016, 6:34 PM

                    @ttrammell it could be because FOG is ordering yum to install those packages using the remi repo.

                    At the very least - you can modify the packages list - and maybe even modify the installer to just not use the remi repo.

                    The best suggestion still stands though - move to CentOS 7. There’s no reason not to, it’s a free and open OS.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    T 1 Reply Last reply Aug 15, 2016, 7:56 PM Reply Quote 0
                    • T
                      ttrammell @Wayne Workman
                      last edited by Aug 15, 2016, 7:56 PM

                      @Wayne-Workman said in Rudimentary Shell Script - SVN Update for CentOS 6.7:

                      The best suggestion still stands though - move to CentOS 7. There’s no reason not to, it’s a free and open OS.

                      I would be totally for it, although this server does nothing but sit there and run fog – which is what a server is supposed to do, now that I think about it.

                      That main reason is redoing the hardware RAID and making sure that is all set right as rain, and that all of our images make the transfer. It’s one of those too much to do in too little of a time frame – I mean this server has been here about 4 years before I got this position and it was still running FOG .29 (While the most updated version was 1.2.0).

                      More or less, I am stuck with it for the time being.

                      In place upgrade probably should not mess anything up, but the should is what I am skeptical about.

                      Yes, I really did just ask that question and I am only /slightly/ ashamed of it.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      1 / 1
                      • First post
                        9/10
                        Last post

                      161

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project