{"id":13558644,"url":"https://github.com/mapcomm/mapping.community-carto_install_doc","last_synced_at":"2025-04-03T13:31:47.099Z","repository":{"id":132479732,"uuid":"90616690","full_name":"mapcomm/mapping.community-carto_install_doc","owner":"mapcomm","description":"Detailed instructions for install process of CartoDB on CentOS7","archived":false,"fork":false,"pushed_at":"2018-09-06T09:50:14.000Z","size":70,"stargazers_count":7,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T09:37:30.155Z","etag":null,"topics":["cartodb","centos7"],"latest_commit_sha":null,"homepage":"http://mapping.community","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapcomm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-08T10:40:03.000Z","updated_at":"2022-02-14T03:11:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"c57e21e0-ce89-4891-a16c-73c18d798a85","html_url":"https://github.com/mapcomm/mapping.community-carto_install_doc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapcomm%2Fmapping.community-carto_install_doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapcomm%2Fmapping.community-carto_install_doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapcomm%2Fmapping.community-carto_install_doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapcomm%2Fmapping.community-carto_install_doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapcomm","download_url":"https://codeload.github.com/mapcomm/mapping.community-carto_install_doc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247009661,"owners_count":20868588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cartodb","centos7"],"created_at":"2024-08-01T12:05:04.755Z","updated_at":"2025-04-03T13:31:46.829Z","avatar_url":"https://github.com/mapcomm.png","language":"Shell","funding_links":[],"categories":["Shell","others"],"sub_categories":[],"readme":"This document provides a step-by-step introduction to the process of installing the full stack for Carto open-source onto a self-hosted server running CentOS 7. We've tried to provide enough narration along the way to make this guide useful to anyone with a cursory level of knowledge of linux and web servers and a high level of persistence. This guide was authored by Jeremy Kidwell at the University of Birmingham, but is the product of a collaboration with a range of persons who helped along the way, see the footnotes for credits and enjoy!\n\n# 1. Provisioning\n\nCartoDB can use a range of resources. For our purposes, which involve installing an instance of CartoDB on a virtual server hosted at the University of Birmingham for the [Mapping Community project](http://mapping.community) we plan to host a range of POI datasets, shapefiles, and demographic data pertaining to community groups in the UK, with the eventual goal of hosting data for the whole of Europe and whoever wants to join in the fun \\(Austrailiasia anyone?\\).\n\nWe set up a local PostgreSQL server with PostGIS extensions in order to test the size of these datasets and projected a maximum use for year 1 of this server of 500GB. For a whole host of best-practice reasons, we've provisioned this setup with a web server and PostGIS server hosted separately \\(but on the same LAN\\). We will run a parallel set of servers in a development platform which will mirror the production setup.\n\n## Firewall Configuration ##\n\nIf you're working with virtual servers that will be behind a firewall, this installation guide will require the following configuration to work. For the sake of this example, \"Server01\" is the web server and \"Server02\" is the postgresql server.\n\n- Server01 should be open to inbound (http) traffic on ports 80, 443, 9090 (SQL API), 9191 (Maps API) for any IP address.\n- Server02 should be open to inbound (postgresql) traffic on port 5432 from Server01\n\nYou will also likely want to have ports open for management, so leaving open port 22 for ssh etc.\n\n# 2. Installation\n\n### A Few Notes on Converting \"CartoDB Ubuntu\" to Centos...\n\nThe CartoDB installation process is well-documented in the [official documentation](http://cartodb.readthedocs.io/en/latest/install.html), however this process is explicitly linked to Ubuntu 12.04 x64. Though relatively similar to Ubuntu, CentOS has a different package manager and dependencies will be handled in a slightly different way, so the purpose of this documentation is to indicate departures from that official documentation for our platform.\n\nThe basic components included in CartoDB include the following:\n\n* PostgreSQL \\(note, as of May 2017 CartoDB requires **PostgreSQL 9.5.x** and **PostGIS 2.2.x** - check the official docs at [http://cartodb.readthedocs.io/en/latest/components/postgresql.html](http://cartodb.readthedocs.io/en/latest/components/postgresql.html) to see if this has changed\\)\n* Redis \\(note, CartoDB requires **redis 3.x** version - check [here](http://cartodb.readthedocs.io/en/latest/components/redis.html) to see if this has changed\n* NodeJS 6.9 \\(the Carto platform is on the way towards transitioning from the former requirement of 0.10 towards 6.x the latter of which we've installed with and tested here)\\ and npm 3.10.9 \\(same as before, so upgrading from official carto doc recommendation of 2.14.16)\\\n* Ruby \\(recommended Ruby 2.2.3\\)\n* [GEOS](http://trac.osgeo.org/geos) 3.5.0, [GDAL](http://www.gdal.org/) 1.11 (though note that CartoDB uses ogr2ogr2 version 2.1.2 in parallel for some features), [Mapnik](http://mapnik.org/), ImageMagick\n* unp, zip, [JSON-C](http://oss.metaparadigm.com/json-c), [PROJ4](http://trac.osgeo.org/proj)\n* CartoDB SQL API \\(found at: git://github.com/CartoDB/CartoDB-SQL-API.git\\)\n* CartoDB MAPS API \\(found at git://github.com/CartoDB/Windshaft-cartodb.git\\)\n* Editor \\(found at [https://github.com/CartoDB/cartodb.git](https://github.com/CartoDB/cartodb.git\\)\n\nPackages are not directly equivalent in the CentOS package manager \"[yum](https://en.wikipedia.org/wiki/Yellowdog_Updater,_Modified)\" to Ubuntu's \"[apt-get](https://en.wikipedia.org/wiki/Advanced_Packaging_Tool)\", so we need to deviate sightly from those packages named in the Ubuntu-based CartoDB install. Best practice is to first check for an easy equivalent which uses the same name in yum. If this doesn't exist, you have two options. You can look for an error message in your compile process and use the command `yum whatprovides \"/[filename here]*` or you can have a look at the actual contents of the Ubuntu package specified using their website here: [http://packages.ubuntu.com](http://packages.ubuntu.com%29%29 and try to find a package that bundles the same components %28or individually!%29 using yum. You can read a bit more about [how to install software on CentOS here]%28https://www.centos.org/forums/viewtopic.php?f=12\u0026t=871) and then use `yum search [pattern to match in package name]`. It is also worth noting that the CartoDB Ubuntu install guide includes several instances where the guide needs packages which are beyond the standard Ubuntu repositories as well. In this case, they provide access to a Carto-specific Ubuntu PPA, PPA being an acronym for Personal Package Archive and essentially just a bundle of precompiled software known to be compatible with a specific system type. You can view the contents of the [CartoDB/GIS PPA by clicking here](https://launchpad.net/%7Ecartodb/+archive/ubuntu/gis). If you're running into compatibility issues or are wondering which version of a component is getting installed, check out the PPA which provides a very specific list!\n\nHere's an example of how we've done this:\n\nOne of the first install commands in Ubuntu is to install the following using apt-get:\n\n```bash\nsudo apt-get install autoconf binutils-doc bison build-essential flex\n```\n\nA quick search [using the command line](https://www.centos.org/docs/5/html/yum/sn-searching-packages.html) reveals that there are some obvious yum equivalents:\n\n`sudo yum install autoconf bison flex`\n\nThis is fine, and we should install these straight-away. But with the above example, we can see that \"binutils-doc\" and \"build-essential\" don't have exact name equivalents in yum. With some careful sleuthing we've found that the proper packages are[^5]:\n\n```bash\nsudo yum install binutils\nsudo yum install gcc gcc-c++ make openssl-devel tcl\n```\n\nYou won't need to go through this process here as we've already identified all the equivalent packages in this guide (or recommended installation from source code in some cases), but in future cases, there may be additional dependencies that need to be resolved, so hopefully enterprising users will be able to conduct appropriate reconnaissance.\n\nTwo other things that are worth noting about the translation from Ubuntu to CentOS/RHEL - paths are specified differently, and often CentOS is more conservative about not passing paths to the shell, this means that you may get file not found errors even when you know that you've already installed the proper package. We address this in a few ways below, but usually good to confirm first when you hit an erorr that it isn't just a matter of a path missing, especially if you're using `sudo`. The other matter to be aware of is that CentOS is tremendously conservative in terms of adopting new frameworks, so we'll just install straight from source below in some cases rather than bothering with the process of trying to get the code installed via a package.\n\nThat's it for now let's get started...\n\n## 2.1 PostgresSQL Server ##\n\n\u003e Note, for our purposes, this guide makes use of two virtual servers . CartoDB can be run on a single server \\(which is how the Ubuntu instructions go\\), so this is just our approach here. We begin by configuring our second virtual server which will host PostgreSQL. This order is necessary because the database is needed when we do the configuration on the Web Server:\n\n### a. Set System Locale[^4]\n\n```bash\nlocaledef -c -f UTF-8 -i en_GB en_GB.UTF-8\nexport LC_ALL=en_GB.UTF-8\n```\n\n### b. Install Basic Requirements:\n\nBegin by installing some of the basic required components of your server:\n\n```bash\nsudo yum install autoconf bison flex binutils\nsudo yum install gcc gcc-c++ make openssl-devel tcl nano wget\nsudo yum install dejavu-sans-fonts lato-fonts open-sans-fonts\n```\n\nIn contrast to Ubuntu, the main CentOS repository lacks many server packages, so it is typical to use the EPEL \\([Extra Packages for Enterprise Linux](https://fedoraproject.org/wiki/EPEL/FAQ#howtouse%29\\) repository and \"voila\" some of the packages noted below, including \"redis\" and \"postgis\" become available:\n\n```bash\nsudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm\n```\n\n\u003e Note: these versions change, so you may want to browse to [http://dl.fedoraproject.org/pub/epel/7/x86\\_64/e/](http://dl.fedoraproject.org/pub/epel/7/x86_64/e/) to see what the latest version is if this doesn't work.\n\n### c. Install Git\n\nYou will need git commands in order to handle some repositories and install some dependencies:\n\n```bash\nsudo yum install git\n```\n\n*Note: in the Ubuntu guide, there is a series of packages listed under \"APT Tools\", in case you're wondering, we've integrated these elsewhere already in this guide, so no need to worry!*\n\n### d. PostgreSQL ###\n\n\n#### Get postgresql 9.5 repository installed\n\n\u003e Note: The default in CentOS at the time this guide was put together was 9.2, so you'll want to be sure that you specify the proper repository. We've also altered all the below to be sure they are specific to 9.5.\n\nHere's how you add the additional repository for postgresql 9.5:\n\n```bash\nsudo rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm\nsudo yum update\n```\n\n#### Install client packages:\n\n```bash\nsudo yum install postgresql95 postgresql95-odbc PyGreSQL\n```\n\n\u003e Note: we were just fine skipping these ubuntu packages from the official Carto install doc: libpq5  libpq-dev  postgresql-client-common \\(many bits are already dependencies or specified in other ways above\\)\n\n#### Install server packages[^6]:\n\n```bash\nsudo yum install postgresql95-server postgresql95-contrib postgresql95-devel postgresql95-plpython\n```\n\nNow we need to initialize our database:\n\n```\nsudo /usr/pgsql-9.5/bin/postgresql95-setup initdb\n```\n\nStart the service:\n\n```\nsudo systemctl start postgresql-9.5\n```\n\nEnable the service to run on startup:\n\n```\nsudo systemctl enable postgresql-9.5.service\n```\n\nModify the pg\\_hba.conf file \\(this is sort of like the firewall configuration for the database server\\) to specify whether it should expect connections from outside, which is quite likely when working with PostGIS. We like to use nano as our text editor: `sudo nano /var/lib/pgsql/9.5/data/pg_hba.conf`\n\nThe contexts of your pg\\_hba.conf should be something like the following \\(with much of the documentation/comments from the actual file excluded here\\), you should probably make it the following \\(for now\\):\n\n```\n# TYPE  DATABASE        USER            ADDRESS                 METHOD\n# \"local\" is for Unix domain socket connections only, modified from stock to \"trust\" as per CartoDB docs\nlocal   all             all                                     trust\n# this addition from CartoDB docs\nlocal   all             postgres                                trust\n# IPv4 local connections:\nhost    all             all             127.0.0.1/32            trust\n# Allow Web Server connection:\nhost    all             Postgres        _webserver IP address_  trust\n# IPv6 local connections:\nhost    all             all             ::1/128                 ident\n# Allow replication connections from localhost, by a user with the\n# replication privilege.\n#local   replication     postgres                                peer\n#host    replication     postgres        127.0.0.1/32            ident\n#host    replication     postgres        ::1/128                 ident\n```\n\n\u003e Note: Be sure you substitute an ip address for your web server as indicated above \"_webserver IP address_\" and don't forget to include a \"/32\" after the address (this is the \"netmask\").\n\nRestart server for changes to take effect:\n\n```\nsudo systemctl restart postgresql-9.5\n```\n\nNow create your Postgres users:\n\n```\nsudo createuser publicuser --no-createrole --no-createdb --no-superuser -U postgres\nsudo createuser tileuser --no-createrole --no-createdb --no-superuser -U postgres\n```\n\n**Install the CartoDB postgresql extension**.\n\nThis extension contains functions that are used by different parts of the CartoDB platform, included the Editor and the SQL and Maps API \\(as below\\).\n\n```\ncd /opt\ngit clone https://github.com/CartoDB/cartodb-postgresql.git\ncd cartodb-postgresql/\n```\n\n\u003e Note: for the next line, have a look at [https://github.com/CartoDB/cartodb-postgresql/tags](https://github.com/CartoDB/cartodb-postgresql/tags) to see what the latest tag is, and then substitute in the line below - this will detach your clone from the branch which may continue to develop! For this install, we've used 0.18.5. It is also worth noting that environment variables aren't passed by default in some linux distributions, including CentOS, so we need to explicitly pass the path variable or the command will fail.[^1]\n\n```\ngit checkout \u003cLATEST cartodb-postgresql tag\u003e\nexport PATH=/usr/pgsql-9.5/bin:$PATH\nsudo env \"PATH=$PATH\" make all install\n```\n\n\u003e Note: tags for an existing install can be discovered using the command `git describe --tags`\n \n### e. GIS dependencies\n\nInstall the following dependencies:\n\n```\nsudo yum install proj proj-devel json-c json-c-devel python-simplejson geos geos-devel gdal gdal-devel gdal-libs gdal-devel \nsudo yum install libjpeg-turbo libjpeg-turbo-devel ImageMagick-devel giflib-devel pango-devel\n```\n\n### f. PostGIS\n\nInstall PostGIS\n\n```\nsudo yum install libxml2-devel\nsudo yum install postgis2_95 postgis2_95-devel libxml2-devel\n```\n\nInitialize template postgis database. We create a template database in postgresql that will contain the postgis extension. This way, every time CartoDB creates a new user database it just clones this template database\n\n```\nsudo createdb -T template0 -O postgres -U postgres -E UTF8 template_postgis\nsudo createlang plpgsql -U postgres -d template_postgis\npsql -U postgres template_postgis -c 'CREATE EXTENSION postgis;CREATE EXTENSION postgis_topology;'\nsudo ldconfig\n```\n\nRun an installcheck to verify the database has been installed properly\n\n```\nsudo PGUSER=postgres make installcheck # to run tests\n```\n\n\u003e Note: check [https://github.com/cartodb/cartodb-postgresql](https://github.com/cartodb/cartodb-postgresql) for further reference\n\nRestart PostgreSQL after all this process\n\n```\nsudo systemctl restart postgresql-9.5\n```\n\nIf you are working with a 2 server configuration, you may also want to edit the postgresql.conf file to tell the server to listen to hosts beyond \"localhost\".\n\n```\nsudo nano  /var/lib/pgsql/9.5/data/postgresql.conf\n```\n\nEdit the line beginning with `# listen_addresses = 'localhost' # what IP address(es) to listen on;`\n\nAt this point your PostgresSQL server installation should be all done, now let's move on to the web server installation:\n\n## 2.2 Web Server ##\n\nLogin to Cartodb Web server (\"Server01\").\n\n### a. Set System Locale[^4]\n\n```bash\nlocaledef -c -f UTF-8 -i en_GB en_GB.UTF-8\nexport LC_ALL=en_GB.UTF-8\n```\n\n### b. Install Basic Requirements:\n\n```bash\nsudo yum install autoconf bison flex binutils\nsudo yum install gcc gcc-c++ make openssl-devel tcl\n```\n\n### c. Install Git\n\nYou will need git commands in order to handle some repositories and install some dependencies:\n\n```bash\nsudo yum install git\n```\n\n### d. PostgreSQL\n\nEven though we're not running PostgreSQL on this server, the web server will require many of the same libraries, so we'll go through a similar process to what we began above for this server here. Add the additional repository for postgresql 9.5:\n\n```bash\nsudo rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm\nsudo yum update\n```\n\nInstall following packages:\n\n```bash\nsudo yum install postgresql95 postgresql95-odbc PyGreSQL postgresql95-devel postgresql95-plpython\n```\n\n### e. GIS dependencies\n\nInstall the following dependencies:\n\n```\nsudo yum install proj proj-devel json-c json-c-devel python-simplejson geos geos-devel gdal gdal-devel gdal-libs gdal-devel \nsudo yum install libjpeg-turbo libjpeg-turbo-devel ImageMagick-devel giflib-devel pango-devel\n```\n\n### f. PostGIS\n\nInstall PostGIS\n\n```\nsudo yum install libxml2-devel\nsudo yum install postgis2_95 postgis2_95-devel libxml2-devel\n```\n\n### g. Redis\n\nNow that we've finished the basics, and replicated essential postgresql components, we'll move on to installation of the web server and the Carto stack.\n\nCentos is too conservative to provide redis 3.x in a package, so we must install from source. At the time of this writing, 3.2.8 was the latest \"stable\" release, but it's [worth clicking here to check first](https://redis.io/download) in case things have moved along. Get and install redis:\n\n```\ncd ~/\nwget http://download.redis.io/releases/redis-3.2.8.tar.gz\ntar xzf redis-3.2.8.tar.gz\ncd redis-3.2.8\nmake\n```\n\n\u003e *Note: if you follow the documentation on redis and attempt a \"make test\", make sure you first check for running \"redis\" processes and kill any that are still running you can find these processes using the following command:* `ps -ef|grep redis` then just run the command: `kill \u003cprocess id number\u003e`\n\nNow install redis as a production server:\n\n```\nsudo make install\ncd utils\nchmod +x install_server.sh\nsudo ./install_server.sh\n```\n\n\u003e Note, the dialogue which will ensue when you run install \\_server.sh, will ask you to specify the path to CLI executable. This should be \"/usr/local/bin/redis-server\"\n\nCheck the status of your redis server:\n\n```\nservice redis_6379 status\n```\n\nIf you want to allow outside access to the redis server \\(which is not necessary, and I can't imagine why one might do so!\\), you should definitely set a password for redis. Open the file for editing using: `nano /etc/redis/6379.conf` then look for the line beginning with `# requirepass foobared` and replace \"foobared\" with a strong alternative. Finish by restarting the redis server with `service redis_6379 restart`\n\n### h. NodeJS[^7]\n\nAs above, it is easier just to install Node.js from source so you can be sure you have the right version installed. On your server, use wget and paste the link that you copied in order to download the archive file:\n\n\u003e Note: at the time of writing, we will need nodeJS v6.9.2 to work with Windshaft-cartodb.\n\n```\ncd ~/\nwget http://nodejs.org/dist/v6.9.2/node-v6.9.2.tar.gz\n```\n\nExtract the archive and move into the new directory by typing:\n\n```\ntar xzvf node-v* \u0026\u0026 cd node-v*\n```\n\nConfigure and compile the software:\n\n```\n./configure --prefix=/usr\nmake\n```\n\nThe compilation will take a wee while. When it is finished, you can install the software onto your system by typing:\n\n```\nsudo make install\n```\n\nTo check that the installation was successful, you can ask Node and NPM \\(the node package manager\\) to display its version number:\n\n```\nnode --version\nnpm -v\n```\n\n### i. Create \"Carto\" User With Sudo Privilege ###\n\nNow let's create a user account which the carto services can run under so that they aren't using your linux user account.\n\n```\nsudo adduser carto\n```\n\nUse the passwd command to update the new user's password (choose a strong option here, as you've already done for redis above. Do write it down, don't use the same password you've used for reds.):\n\n```\nsudo passwd carto\n```\n\nUse the usermod command to add the user to the wheel group.\n\n```\nsudo usermod -aG wheel carto\n```\n\nYou're going to need to login to this new user account so that file permissions and ownership are set properly when you install the CartoDB stack in a moment.\n\n```\nsu carto\n```\n\n### j. Ruby\n\nDownload ruby-install. Ruby-install is a script that makes ruby install easier. It’s not needed to get ruby installed but it helps in the process.\n\n```bash\ncd ~/\nwget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz\ntar -xzvf ruby-install-0.5.0.tar.gz\ncd ruby-install-0.5.0/\nsudo make install\n```\n\nInstall some ruby dependencies\n\n```\nsudo yum install readline-devel bzip2\n```\n\nInstall ruby 2.2.3. CartoDB has been deeply tested with Ruby 2.2.\n\n```\nsudo env \"PATH=$PATH\" ruby-install ruby 2.2.3\n```\n\nRuby-install will leave everything in /opt/rubies/ruby-2.2.3/bin. To be able to run ruby and gem later on, you’ll need to add the Ruby 2.2.3 bin folder to your PATH variable. It’s also a good idea to include this line in your bashrc so that it gets loaded on restart\n\n```\nexport PATH=$PATH:/opt/rubies/ruby-2.2.3/bin\n```\n\nInstall bundler. Bundler is an app used to manage ruby dependencies. It is needed by CartoDB’s editor\n\n```\nsudo env \"PATH=$PATH\" gem install bundler\n```\n\nInstall compass. It will be needed later on by CartoDB’s editor\n\n```\nsudo env \"PATH=$PATH\" gem install compass\n```\n\n\n### k. GCC Library\n\nThe system wide GCC library from Centos 7 is incompatible with CartoDB MAP API. Therefore we will need to manually compile the library and make it available for later use. The minimum version of GCC is v5.1.0.\n\nFirst install prerequisites:\n\n```\nsudo yum install gmp gmp-devel mpfr mpft-devel libmpc libmpc-devel zip unzip gdal-devel\n```\n\nThe install GCC, from which we'll extract the library:\n\n```\ncd ~/\nwget http://gnu.uberglobalmirror.com/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2\ntar -xjf gcc-5.1.0.tar.bz2\ncd gcc-5.1.0\n./configure --disable-multilib\nmake\n```\n\n\u003e Note: the compile will take a while as there are huge number of objects to run through.\n\nAt this point, we do not need to \"make install\" as we only need to copy the library file (libstdc++.so.6.0.21) to the system /lib64 folder\n\n```\nsudo cp ./prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.21 /lib64/\n```\n\nUpdate current symbolic link of the library\n\n```\nsudo rm /lib64/libstdc++.so.6\nsudo ln -s /lib64/libstdc++.so.6.0.21 /lib64/libstdc++.so.6\n```\n\n\n### l. GDAL 2.1.2\n\nThe Centos repository only provides GDAL v1.11.4 so we will need to install the latest GDAL v2.1.2 from source. It was originally the case (and is still documented) that Carto uses two versions of GDAL in parallel, in order to borrow some features that were reintroduced in GDAL 2.x, but this use seems to have been deprecated. Our installation here will install GDAL v2.1.2 without any other side loaded versions of GDAL.\n\n```\ncd ~/\nwget http://download.osgeo.org/gdal/2.1.2/gdal-2.1.2.tar.gz\ntar -xzf gdal-2.1.2.tar.gz\ncd gdal-2.1.2\n./configure --with-geos=yes --with-pg=/usr/pgsql-9.5/bin/pg_config --prefix=/usr\nmake\nsudo make install\n```\n\u003e Note: the two flags included above for 'configure' are very important. Make sure that GEOS support shows \"yes\" and that the install script is able to find pg_config and PostgresQL.\n\n\n### m. Add unp (decompression tool) to Centos\n\nCartoDB requires the `unp` package to decompress any zip files. But `unp` is not available as standard RPM package for Centos, as it was designed for Debian and ported to Ubuntu. Luckily for us, because it is a perl script, the process of porting to Centos is nonexistent. One only needs to download the script straight from the Debian repository and make it executable:\n\n```\ncd /usr/bin\nsudo wget https://sources.debian.net/data/main/u/unp/2.0~pre7+nmu1/unp\nchmod 755 /usr/bin/unp\n```\n\nAll done. Let's move on to begin installing CartoDB components:\n\n### n. CartoDB Components ###\n\n#### Editor\n\nDownload the editor code:\n\n```\ncd /opt\nsudo git clone --recursive https://github.com/CartoDB/cartodb.git\nsudo chown -R carto cartodb\ncd cartodb\n```\n\nInstall pip:\n\n```\nsudo wget  -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py\nsudo python /tmp/get-pip.py\n```\n\nInstall a necessary package for python dependencies:\n\n```\nsudo yum install python-devel\n```\n\nInstall dependencies\n\n```bash\nsudo yum install ImageMagick patch\nexport PATH=$PATH:/usr/pgsql-9.5/bin/:/opt/rubies/ruby-2.2.3/bin\nRAILS_ENV=production bundle install --deployment --without development test\nnpm install\nsudo env \"PATH=$PATH\" pip install --no-use-wheel -r python_requirements.txt --global-option=build_ext --global-option=\"-I/usr/include/gdal\"\n```\n\n\u003e Reminder: environment name is used above. Also note that \"bundle install\" above will fail if \"/usr/pgsql-9.5/bin and \"/opt/rubies/ruby-2.2.3/bin\" is not included in your $PATH statement. Best practices on CentOS suggest that your path should be modified using a script in /etc/profile.d.\n\nAdd the grunt command to the PATH:\n\n```\nexport PATH=$PATH:$PWD/node_modules/grunt-cli/bin\n```\n\nInstall all necessary gems:\n\n```\nbundle install\n```\n\nPrecompile assets. Note that the last parameter is the environment used to run the application. It must be the same used in the Maps and SQL APIs\n\n```bash\ncp config/grunt_development.json config/grunt_production.json\nulimit -n 2560\nbundle exec grunt --environment production\n```\n\n\u003e Reminder: environment name here, but note that we're using the template for development to make our \"grunt\\_production.json\". You can omit this first line above if working with a \"development\" environment as there is \\(obviously\\) already a config file for grunt\\_development.\n\nCreate configuration files:\n\n```\ncp config/app_config.yml.sample config/app_config.yml\ncp config/database.yml.sample config/database.yml\n```\n\n\u003e Note: modify database.yml to include details of your database \\(in our case using the details of Server02\\) if you're not using localhost.\n\nInitialise the metadata database:\n\n```\nRAILS_ENV=production bundle exec rake db:create\nRAILS_ENV=production bundle exec rake db:migrate\n```\n\n\u003e Reminder: above should be modified if using \"development\" environment.\n\nNow modify configuration files for the carto web application:\n\n```\nnano /opt/cartodb/config/app_config.yml\n```\n\nChange the line starting with: `session_domain:     '.localhost.lan'` to: `session_domain:     'carto.mapping.community'`\n\nChange the line starting with: `subdomainless_urls: false` to: `subdomainless_urls: true`\n\nChange the line starting with: `vizjson_cache_domains: ['.localhost.lan']` to `#  vizjson_cache_domains: ['.localhost.lan']` (it should be commented out)\n\n(JK Note: next line unsure - may need to revert this to a side loaded configuration, cf. original Readme.md from May, content under \"Now finally edit the hosts file to include `localhost.lan` and whatever your server URL will be\")\n\nChange the line starting with: `account_host:       'localhost.lan:3000'` to: `account_host:       'carto.mapping.community'`\n\nMake the following changes to the `sql_api` section of this file as below: \n\n```\n  sql_api:\n    private:\n      protocol:   'https'\n      domain:     'carto.mapping.community'\n      endpoint:   '/api/v1/sql'\n      port:       9090\n    public:\n      protocol:   'https'\n      domain:     'carto.mapping.community'\n      endpoint:   '/api/v2/sql'\n      port:       9090\n```\n\nMake the following changes to the `tiler` section of this file as below:\n```\n  tiler:\n    filter: 'mapnik'\n    internal:\n      protocol:      'https'\n      domain:        'carto.mapping.community'\n      port:          '9191'\n      host:          'carto.mapping.community'\n      verifycert:     false\n    private:\n      protocol:      'https'\n      domain:        'carto.mapping.community'\n      port:          '9191'\n      verifycert:     false\n    public:\n      protocol:      'https'\n      domain:        'carto.mapping.community'\n      port:          '9191'\n      verifycert:     false\n```\n\nSave the app_config.yml file and then edit the hosts file to include `localhost.lan` and whatever your server URL will be:\n\n```\nsudo nano /etc/hosts\n```\n\nAdd the following line:\n\n```\n127.0.0.1   localhost.lan carto.mapping.community\n```\n\nCreate /etc/carto so we can edit all the config files in here\n\n```\nsudo mkdir /etc/carto\ncd /etc/carto\nsudo ln -s /opt/cartodb/config\n```\n\nCreate /var/log/carto so we can put all the logs files in here\n\n```\nsudo mkdir /var/log/carto\nsudo chmod 777 /var/log/carto\n```\n\n### o. CartoDB APIs\n\nAll the hard work above has paid off, as you have a working server environment that will provide the basis for an installation of the Carto platform:\n\n#### SQL API:\n\nDownload API:\n\n\u003e Note, here and below we need to copy all the core cartodb files into the system-wise web server paths so that they aren't being served out of our home directory. We're going with /opt for our files here ([to see why, read here](http://serverfault.com/questions/96416/should-i-install-linux-applications-in-var-or-opt)):\n\n```\ncd /opt\nsudo git clone git://github.com/CartoDB/CartoDB-SQL-API.git\nsudo chown -R carto CartoDB-SQL-API\ncd /opt/CartoDB-SQL-API\ngit checkout master\n```\n\n\u003e Note: if you want to install a different version of this API, be sure to change \"master\" in the above to reflect either the `tags/[name of tag]` or the exact version name.\n \nInstall npm dependencies\n\n```\nnpm install\n```\n\nCreate your configuration files from the templates provided in the config directory. Note, the name of the filename of the configuration must be the same than the environment you are going to use to start the service.\n\n\u003e Note: departing from the standard Carto instruction set, we've specified the environment as production, because we are running two parallel environments \\(yep, 4 virtual servers\\). Do make a note of the fact that the name of the environment will crop up increasingly often further below, so best to do a word search for \"production\" and substitute as necessary if you want to run a \"development\" environment.\n\n```\ncp config/environments/production.js.example config/environments/production.js\n```\n\nNote: As you'll already know, our project is hosted at carto.mapping.community. You'll want to substitute every instance of \"mapping.community\" in the prescribed configuration changes here and below for your own DNS name otherwise the server will definitely not work.\n\nWe need to modify the SQL-API configuration file so that the server will work with our DNS name:\n\n```\nnano /opt/CartoDB-SQL-API/config/environments/production.js\n```\n\nChange the setting for `module.exports.node_host` to: \n\n```\nmodule.exports.node_host    = '';\n```\n\nChange the line starting with: `module.exports.user_from_host` to:\n\n```\nmodule.exports.user_from_host = '^(.*)\\\\.carto\\\\.mapping\\\\.community$';\n```\n\n\u003e Note: hostname to change above!\n\nChange the setting for `module.exports.db_host` to your PostgreSQL server IP:\n\n```\nmodule.exports.db_host      = 'PostgresSQL server IP address';\n```\n\nChange the setting for `module.exports.db_port` to:\n\n```\nmodule.exports.db_port      = '5432';\n```\n\nChange `allowedHosts` to use your domain name:\n\n```\nmodule.exports.oauth = {\n    allowedHosts: ['carto.mapping.community']\n```\n\n\u003e Note: hostname to change above!\n\nChange `module.exports.log_filename` to a central log location:\n```\nmodule.exports.log_filename = '/var/log/carto/log/SQL-API_log'\n```\n\nNow, try to start the service to confirm that it is installed correctly (note, again the second parameter is always the environment if the service. Remember to use the same you used in the configuration).\n\n```\nnode app.js production\n```\n\n\u003e Reminder: see note a few lines above re: \"production\" here which is \"development\" in carto documentation.\n\n#### MAPS API:\n\nDownload the API:\n\n```\ncd /opt\nsudo git clone git://github.com/CartoDB/Windshaft-cartodb.git\nsudo chown -R carto Windshaft-cartodb\ncd Windshaft-cartodb\ngit checkout master\n```\n\nInstall npm dependencies:\n\n```\nnpm install\n```\n\nCreate configuration. The name of the filename of the configuration must be the same than the environment you are going to use to start the service. Let’s assume it’s production\n\n\u003e Reminder: environnment name below \\(as noted above\\)!\n\n```\ncp config/environments/production.js.example config/environments/production.js\n```\n\nYou need to make some crucial modifications to the windshaft configuration file:\n\n\u003e Reminder: specific DNS settings below!\n\n```\nnano /opt/Windshaft-cartodb/config/environments/production.js\n```\n\nChange the setting for `,host:`  to be empty, as below:\n\n```\nvar config = {\n    environment: 'production'\n    ,port: 8181\n    ,host: '' \n```\n\nChange the setting for `,user_from_host` to reflect your hostname, formatted as follows:\n\n```\n,user_from_host: 'carto\\\\.mapping\\\\.community'\n```\n\nChange the setting under `,postgres` for host and port to reflect your PostgreSQL settings (as follows), substituting your IP for 'postgres server IP' below and `5432` for port:\n\n```\n,postgres: {\n        // Parameters to pass to datasource plugin of mapnik\n        // See http://github.com/mapnik/mapnik/wiki/PostGIS\n        user: \"publicuser\",\n        password: \"public\",\n        host: 'postgres server IP',\n        port: 5432,\n```\n\nUnder `,analysis` change the endpoint url to match your server url, using the following convention:\n\n```\n            endpoint: 'http://carto.mapping.community:8080/api/v2/sql/job'\n```\n \nand change the `hostHeaderTemplate`  in the same way:\n\n```\n            hostHeaderTemplate: '{{=it.username}}.carto.mapping.community'\n```\n\nUnder `,millstone` change the setting for cache_basedir to\n\n```\n        cache_basedir: '/opt/cartodb/tile_assets/'\n```\n\nChange `log_filename` to a central log location:\n```\nlog_filename: '/var/log/carto/log/node-windshaft.log'\n```\n\nFinally, make sure you change the options for cnd_url to be null as follows:\n\n```\n  cdn_url: {\n    http: '',\n    https: '',\n```\n\nSave the changes you've made above to the windshaft configuration file and proceed. \n\nNow, create the cache_basedir folder if it doesn't exist: \n\n```\nmkdir /opt/cartodb/tile_assets/\n```\n\nStart the service to check if it is installed correctly. The second parameter is always the environment of the service. Remember to use the same you used in the configuration.\n\n```bash\nnode app.js production\n```\n\n\u003e Reminder environnment name above \\(as noted above\\)! \n\nIf this step fails saying log folder not found, you may need to manually create it, e.g. `mkdir /opt/Windshaft-cartodb/logs`\n\n\n### p. Install Apache and Passenger ###\n\nNow we need a web server which we'll use with passenger to connect to the Carto rails server. NGINX is what Carto uses for their production servers, but we've gone with Apache for the sake of convenience. There are some indications that performance is better for high-volume installations using NGINX, so that's the main reason to defer to the alternative.\n\nBecause Carto is fundamentally a rails web server, we will need to use Passenger to connect the rails web server to Apache. By default, web applications running behind rails use non-standard ports. We will use the passenger web proxy along with the apache web server to redirect traffic to default web server ports 80/443. \n\nFor this section, you may want to brief the very helpful guides located on the [Passenger website](https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/rubygems_norvm/install_passenger.html) \\(for a non-rvm setup into NGINX on CentOS\\) and [Passenger App install guide](https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/rubygems_norvm/deploy_app.html) (starting from step 3).\n\nInstall Apache:\n\n```\nsudo yum install httpd\n```\n\nInstall Passenger:\n\n```\nsudo env \"PATH=$PATH\" gem install passenger\n```\n\nSet SELinux to permissive:\n\n```\nsudo setenforce 0\n```\n\nInstall some dependencies:\n\n```\nsudo yum install libcurl-devel httpd-devel\n```\n\nRun the Passenger Apache module installer:\n\n```\nsudo env \"PATH=$PATH\" passenger-install-apache2-module\n```\n\nThe module installer will take you through a brief dialogue. You can just hit the enter key after each prompt to confirm that you are happy with the default selection (a \"Ruby\" focussed install), it will then compile and install passenger for apache.\n\n### q. Generate self-signed SSL certificate\n\nBecause we're using https, we need to assign some secure certificates to our web server. Note, you should strongly resist any suggestions that you need to pay for https certificates. There is absolutely no reason to pay a Certificate authority for your certificates when perfectly secure and respected services like letsencrypt.com exist! We'll start with self-signed certificates and then go on to install letsencrypt certificates which will be automatically renewed using certbot below:\n\n```\nsudo mkdir /etc/httpd/certs/ \nsudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/certs/OurKey.key -out /etc/httpd/certs/OurCert.crt\n```\n\n### r. Configure Apache/Passenger with virtualhost and reverse proxy\n\nAdd a new config file `passenger.conf`\n\n```\ncd /etc/httpd/conf.d/\nsudo nano passenger.conf\n```\n\nPaste the following into your new `passenger.conf` file and save:\n\n\u003eNote: be sure you change DNS below to your own hostname; also IMPORTANT - check to see what version of passenger was installed by the above command and adjust the lines below to reflect the proper path name, which includes the version (\"5.1.3\" here, but 5.1.7 as of the last revision of this document).\n\n```\n   LoadModule passenger_module /opt/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/passenger-5.1.3/buildout/apache2/mod_passenger.so\n   \u003cIfModule mod_passenger.c\u003e\n     PassengerRoot /opt/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/passenger-5.1.3\n     PassengerDefaultRuby /opt/rubies/ruby-2.2.3/bin/ruby\n   \u003c/IfModule\u003e\n\u003cVirtualHost *:80\u003e\n    ServerName carto.mapping.community\n\n    # Tell Apache and Passenger where your app's 'public' directory is\n    DocumentRoot /opt/cartodb/public\n    RailsEnv production\n    SetEnv RAILS_LOG_BASE_PATH /var/log/carto\n    SetEnv RAILS_CONFIG_BASE_PATH /etc/carto\n    # Relax Apache security settings\n    \u003cDirectory /opt/cartodb/public\u003e\n      AllowOverride all\n      Allow from all\n      Options -MultiViews\n      # Uncomment this if you're on Apache \u003e= 2.4:\n      Require all granted\n    \u003c/Directory\u003e\n\u003c/VirtualHost\u003e\n\n\u003cVirtualHost *:443\u003e\n    ServerName carto.mapping.community\n    ServerAlias carto.mapping.community\n    # !!! Be sure to point DocumentRoot to 'public'!\n    DocumentRoot /opt/cartodb/public\n    RailsEnv production\n    # This will let CartoDB write all logs to /var/log/carto\n    SetEnv RAILS_LOG_BASE_PATH /var/log/carto\n    # This will change CartoDB to read all configs from /etc/carto\n    SetEnv RAILS_CONFIG_BASE_PATH /etc/carto\n    PassengerSpawnMethod direct\n\n    SSLEngine on\n\n    SSLCertificateFile /etc/httpd/certs/OurCert.crt\n    SSLCertificateKeyFile /etc/httpd/certs/OurKey.key\n\n    \u003cDirectory /opt/cartodb/public\u003e\n        # This relaxes Apache security settings.\n        AllowOverride all\n        Allow from all\n        Require all granted\n        # MultiViews must be turned off.\n        Options -MultiViews\n    \u003c/Directory\u003e\n\u003c/VirtualHost\u003e\n```\n\n\u003e Note: if you are using certbot (see below) you must manually edit these two lines (from above) to use the following instead (YOUR_DIRECTORY should be changed to the domain name based directory assigned by certbot):\n\n```\nSSLCertificateFile /etc/letsencrypt/live/YOUR_DIRECTORY/cert.pem\nSSLCertificateKeyFile /etc/letsencrypt/live/YOUR_DIRECTORY/privkey.pem\n```\n\nWe'll need to create a separate configuration file to enable reverse proxy for the Carto SQL_API:\n\n```\nsudo nano sqlapi.conf\n```\n\nPaste the following into your new `sqlapi.conf` file and save:\n\n\u003eNote: be sure you change DNS below to your own hostname\n\n```\nListen 9090\n\nNameVirtualHost *:9090\n\n\u003cVirtualHost *:9090\u003e\n    SSLProxyEngine On \n    ServerName carto.mapping.community\n\n    SSLEngine on\n\n    SSLCertificateFile /etc/httpd/certs/OurCert.crt\n    SSLCertificateKeyFile /etc/httpd/certs/OurKey.key\n\n    # this preserves original header and domain\n    ProxyPreserveHost On\n\n    ProxyPass / http://localhost:8080/\n    ProxyPassReverse / http://localhost:8080/\n\n\u003c/VirtualHost\u003e\n```\n\n\u003e Note: if you are using certbot (see below) you must manually edit these two lines (from above) to use the following instead (YOUR_DIRECTORY should be changed to the domain name based directory assigned by certbot):\n\n```\nSSLCertificateFile /etc/letsencrypt/live/YOUR_DIRECTORY/cert.pem\nSSLCertificateKeyFile /etc/letsencrypt/live/YOUR_DIRECTORY/privkey.pem\n```\n\nCreate a separate configuration file to enable reverse proxy for the Windshaft-carto:\n\n```\nsudo nano mapapi.conf\n```\n\n\u003eNote: be sure you change DNS below to your own hostname\nPaste the following into your new `mapapi.conf` file and save:\n\n```\nListen 9191\n\nNameVirtualHost *:9191\n\n\u003cVirtualHost *:9191\u003e\n    SSLProxyEngine On \n    ServerName carto.mapping.community\n\n\n    SSLEngine on\n\n    SSLCertificateFile /etc/httpd/certs/OurCert.crt\n    SSLCertificateKeyFile /etc/httpd/certs/OurKey.key\n\n    # this preserves original header and domain\n    ProxyPreserveHost On\n\n    # hardcoded for now, need to fix\n    ProxyPass / http://localhost:8181/\n    ProxyPassReverse / http://localhost:8181/\n\n\n\u003c/VirtualHost\u003e\n```\n\n\u003e Note: if you are using certbot (see below) you must manually edit these two lines (from above) to use the following instead (YOUR_DIRECTORY should be changed to the domain name based directory assigned by certbot):\n\n```\nSSLCertificateFile /etc/letsencrypt/live/YOUR_DIRECTORY/cert.pem\nSSLCertificateKeyFile /etc/letsencrypt/live/YOUR_DIRECTORY/privkey.pem\n```\n\nNow start apache:\n\n```\nsudo systemctl start httpd\n```\n\n### s. Install Certbot to Use letsencrypt SSL Certificate (Optional) ###\n\nThe EFF has set up free hosting for secure certificates with a large federation of top-tier web-hosting firms via [http://letsencrypt.org]. You can read more on their website about the service. We'll be using the apache instance of \"certbot\" to keep our ssl certificates fresh:\n\n```\nsudo yum -y install yum-utils\nsudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional\nsudo yum install python-certbot-apache\n```\n\nOnce Certbot is installed, run it and let it replace the existing self-signed certificate we created above:\n\n```\nsudo certbot --apache\n```\n\nMake sure you have modified the directives `SSLCertificateFile` and `SSLCertificateKeyFile` across all relevant Apache configuration files as noted in the previous section. You can check whether there are lines you've missed using the following command:\n\n```\ngrep -R SSLCertificate * /etc/httpd/conf.d/*\n```\n\nMake sure you restart the apache server after all these changes have been made:\n\n```\nsudo systemctl restart httpd\n```\n\n\n#### **Start the Server \\(to Test Out Functionality\\)** ####\n\nWe're nearly done now, so it's time to start up all the services and see how they work!\n\nFirst, start the `redis-server` that allows access to the SQL and Maps APIs:\n\nNote, because we've run `sudo ./install_server.sh` as part of the redis install above, there's no need to run `redis-server \u0026` here as is specified in the carto install documentation. Worth double checking, but if you've followed this guide redis should already be running.\n\nStart the two import services using node:\n\n```\ncd /opt/CartoDB-SQL-API \u0026\u0026 node app.js production \u0026\ncd /opt/Windshaft-cartodb \u0026\u0026 node app.js production \u0026\n```\n\nStart Apache/Passenger\n\n```\nsudo service httpd start\n```\n\n\u003e Reminder: environment name above!\n\nIn a different process/console start the resque process (this serves map tiles and responds to requests)\n\n```\nexport PATH=$PATH:/opt/rubies/ruby-2.2.3/bin\nRAILS_ENV=production bundle exec ./script/resque\n```\n\n\u003e Reminder: environment name above!\n\nTest that your server is up:\n\n```\ncurl localhost\n```\n\nThis should return:\n\u003chtml\u003e\u003cbody\u003eYou are being \u003ca href=\"https://[yourURL]/login\"\u003eredirected\u003c/a\u003e.\u003c/body\u003e\u003c/html\u003e\n\nYou can also navigate in a web browser to your server URL and confirm that you see a pretty dark blue Carto login screen.\n\nThe most likely culprit at this point if you're unable to connect to your new server is a firewall policy. To test whether your server is accessible try the following command from another desktop that should have access to the server:\n\n```bash\ntelnet \u003cserver domain name\u003e 443\ntelnet \u003cserver domain name\u003e 80\n```\n\nThis command will try to set up an (unsuccessful) telnet session to your web server on the server ports http (80) and https (443). If you see something like the following, albeit with your server's IP address, your server is accessible:\n\n```\n$ telnet 147.188.126.125 443\nTrying 147.188.126.125...\nConnected to 147.188.126.125.\nEscape character is '^]'.\n```\n\nYour attempts to connect to the server should also register in the apache access logs, so you can use the command `sudo tail /var/log/httpd/access_log` to show the last few lines of your apache log. There should be a time stamped indication of your access attempts, something like:\n\n```\n\u003cworkstation IP address omitted\u003e - - [09/May/2017:11:36:12 +0100] \"GET /login HTTP/1.1\" 200 3997 \"https://carto.mapping.community/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8\"\n```\n\nTo look for problems, use the following commands to check relevant log files:\n\n```\nsudo tail /var/log/httpd/error_log\nsudo tail /var/log/carto/log/production.log\n```\n\nYou may also want to turn off software firewalls to see if they're causing issues. On Centos this will be either:\n\n```\nsystemctl stop firewalld\nsystemctl stop iptables\n```\n\nYou can take snippets of text from error messages to try and find some help with your configuration on stack exchange, a slack group, or the carto google group.\n\nNow hopefully you're up and running, there are a few steps still required to get user accounts created and open up features on your new server:\n\n# 3. Additional Configuration to do after the Carto stack is running #\n\n## 3.1 Carto User and Group Configuration\n\n### a. Create users and organisations\n\nWith a rails web app you use `bundle exec rake` to perform modifications to the database. To get a complete list of your options available, run the following command: `RAILS_ENV=production bundle exec rake -T`\n\nThere are a few things that can cause problems for running this:\n(1) make sure you are in the proper path /opt/cartodb\n(2) make sure your path variable still includes ruby, the following command will sort things for you `export PATH=$PATH:/opt/rubies/ruby-2.2.3/bin`\n(3) make sure you precede your bundle command by setting the rails environment to \"production\" (unless you've gone with a development environment!)\n(4) Pay attention to where you are using single and double quotes. And make sure your word processor hasn't change them to \"smart quotes\"\n\nIf these things are in place, you should be able to run a whole range of system tasks to create users, organisations, and set user settings. You should begin by setting up the publicuser account and then creating one for yourself:\n\n```\ncd /opt/cartodb\nRAILS_ENV=production bundle exec rake cartodb:db:create_publicuser\nRAILS_ENV=production bundle exec rake cartodb:db:create_user SUBDOMAIN='username' EMAIL='user@domain.com' PASSWORD='password'\n```\n\n\u003e note: replace \"username\", \"email address\", and \"password\" above with your preferences.\n\nNow let's elevate your account privileges. To save time later, we're going to rely on an environment variable to set the username (\"Subdomain\" in cartodb vernacular) so that you can actually cut and paste most of the commands from this guide:\n\n```\nexport SUBDOMAIN=YOUR_USERNAME\nRAILS_ENV=production bundle exec rake cartodb:db:set_user_quota[\"${SUBDOMAIN}\",10240]\nRAILS_ENV=production bundle exec rake cartodb:db:set_unlimited_table_quota[\"${SUBDOMAIN}\"]\nRAILS_ENV=production bundle exec rake cartodb:db:set_user_private_tables_enabled[\"${SUBDOMAIN}\",'true']\nRAILS_ENV=production bundle exec rake cartodb:db:set_user_account_type[\"${SUBDOMAIN}\",'[DEDICATED]']\nRAILS_ENV=production bundle exec rake cartodb:set_custom_limits_for_user[\"${SUBDOMAIN}\",import_fil‌e_size,table_row_cou‌nt,concurrent_import‌s]\nRAILS_ENV=production bundle exec rake user:change:max_layers[\"${SUBDOMAIN}\",25]\n```\n\nNow your account has a 10gb storage limit, unlimited tables, the ability to create private tables, and a \"dedicated\" class account.\n\nYou can re-use the command listed above to create more user accounts. You may also want to create organisations. The following command will do this for you:\n\n```\nRAILS_ENV=production bundle exec rake cartodb:db:create_new_organization_with_owner ORGANIZATION_NAME='birmingham-uni' ORGANIZATION_DISPLAY_NAME='University of Birmingham Researchers' ORGANIZATION_SEATS='25' ORGANIZATION_QUOTA='1073741824' USERNAME='ADMIN_USER'\n```\n\n\u003e Note: You need to change USERNAME above to reflect a user account to serve as \"owner\" for the organisation. Make sure you've already created this account before running this command. You should also change the ORGANIZATION_NAME, ORGANIZATION_DISPLAY_NAME to something that matches your preferred settings. \n\n### b. Activate \"Sync Tables\" ###\n\nThis feature enables you to regularly synchronise a table in carto with another external source. It's a fantastic feature and very useful if you work with other data sources. To enable it:\n\nAs above begin by logging into the PostgresSQL server\n\n```\nsudo su\nsu postgres\npsql carto_db_production\n\nUPDATE users SET sync_tables_enabled = 't';\n\n\\q\nexit\nexit\n```\n\nsync tables also require a script to run every 15 minutes, which will enqueue pending synchronizations (run this in the cartodb/ directory):\n\n```\nRAILS_ENV=production bundle exec rake cartodb:sync_tables\n```\n\nThis command will need to be scheduled to run at a regular interval, i.e. every 15 minutes or so. Also, the environment should be changed in the command as necessary. Add to crontab like this:\n\n```\n*/15 * * * *    cd /opt/cartodb \u0026\u0026 RAILS_ENV=production /opt/rubies/ruby-2.2.3/bin/bundle exec rake cartodb:sync_tables\n```\n\nYou may also want to enable specific external data sources, like arcgis. To do this, edit `/opt/cartodb/config/app_config.yml` and modify the following lines:\n\n```\n  datasources:\n    arcgis_enabled: true\n```\n\nWhile you're in there, you may also want to edit a few other lines in `/opt/cartodb/config/app_config.yml` for instance, the email address to be used for outbound messages:\n\n```\n  mailer:\n    from: 'from name \u003cemail@address.com\u003e'\n```\n\n## 3.2 CentOS Server Configuration for Production Carto\n\n### a. systemd service for CartoDB-SQL-API\n\n\u003e Note: system services that you will create below are also located in \"config\" in this repository.\n\nCreate a systemd service which we can use to load CartoDB-SQL-API:\n\n```\ncd /etc/systemd/system\nsudo nano cartodb-sql.service\n```\n\nEdit (or create) the file and save:\n\n```\n[Service]\nExecStart=/usr/bin/node /opt/CartoDB-SQL-API/app.js production\nRestart=always\nStandardOutput=\"/var/log/carto/log/SQL-API_log\"\nStandardError=\"/var/log/carto/log/SQL-API_log\"\nSyslogIdentifier=CartoDB-SQL-API\nWorkingDirectory=/opt/CartoDB-SQL-API\nUser=carto\nGroup=carto\nEnvironment='NODE_ENV=production'\n\n[Install]\nWantedBy=multi-user.target\n```\n\nCreate the empty log file manually\n\n```\ntouch /var/log/carto/log/SQL-API_log\n```\n\nStart CartoDB-SQL-API\n\n```\nsystemctl start cartodb-sql\n```\n\nEnable it to auto-startup at boot\n\n```\nsystemctl enable cartodb-sql\n```\n\n### b. systemd service for Windshaft-cartodb\n\nAdd Windshaft-cartodb to systemd service:\n\n```\ncd /etc/systemd/system\nsudo nano windshaft-cartodb.service\n```\n\nEdit the file and save:\n\n```\n[Service]\nExecStart=/usr/bin/node /opt/Windshaft-cartodb/app.js production\nRestart=always\nStandardOutput=\"/var/log/carto/log/Windshaft_log\"\nStandardError=\"/var/log/carto/log/Windshaft_log\"\nSyslogIdentifier=Windshaft-cartodb\nWorkingDirectory=/opt/Windshaft-cartodb\nUser=carto\nGroup=carto\nEnvironment='NODE_ENV=production'\n\n[Install]\nWantedBy=multi-user.target\n```\n\nCreate the empty log file manually\n\n```\ntouch /var/log/carto/log/Windshaft_log\n```\n\nStart CartoDB-SQL-API\n\n```\nsystemctl start windshaft-cartodb\n```\n\nEnable it to auto-startup at boot\n\n```\nsystemctl enable windshaft-cartodb\n```\n\n### c. systemd service for CartoDB Resque process\n\nCreate a bash script\n\n```\ncd /opt/cartodb/script\nnano run_resque.sh\n```\n\nEdit and save the file as below:\n\n```\n#!/bin/sh\n\nexport PATH=$PATH:/opt/rubies/ruby-2.2.3/bin\ncd /opt/cartodb\nRAILS_ENV=production /opt/rubies/ruby-2.2.3/bin/bundle exec /opt/cartodb/script/resque \u0026\u003e /var/log/carto/log/resque_log\n```\n\nMake the script executable\n\n```\nchmod 775 run_resque.sh\n```\n\nCreate the empty log file manually\n\n```\ntouch /var/log/carto/log/resque_log\n```\n\nAdd cartodb-resque to systemd service:\n\n```\ncd /etc/systemd/system\nsudo nano cartodb-resque.service\n```\n\nEdit the file and save:\n\n```\n[Service]\nExecStart=/bin/sh /opt/cartodb/script/run_resque.sh\nRestart=always\nStandardOutput=\"/var/log/carto/log/resque_log\"\nStandardError=\"/var/log/carto/log/resque_log\"\nSyslogIdentifier=cartodb-resque\nWorkingDirectory=/opt/cartodb\nUser=carto\nGroup=carto\nEnvironment='NODE_ENV=production'\n\n[Install]\nWantedBy=multi-user.target\n```\n\nStart cartodb-resque\n\n```\nsystemctl start cartodb-resque\n```\n\nEnable it to auto-startup at boot\n\n```\nsystemctl enable cartodb-resque\n```\n\n\n### d. Configure Redis Persistence\nWe will need to enable AOF Persistence so Redis will store information that need to be persisted.\n\n```\nsudo nano /etc/redis/6379.conf\n```\n\nChange `appendonly no` to `appendonly yes`\n\nRestart redis\n\n```\nsudo systemctl restart redis_6379\n```\n\n## 3.3 Install Additional Carto Services (data services, observatory, etc.)\n\n### a. Carto Data Services API\n\nLogin to DB server\n\nInstall server and client extensions:\n\n```\ncd /opt\ngit clone https://github.com/CartoDB/dataservices-api.git\nexport PATH=$PATH:/usr/pgsql-9.5/bin/\ncd dataservices-api\ncd client \u0026\u0026 sudo make install\ncd -\ncd server/extension \u0026\u0026 sudo make install\n```\n\nInstall python library:\n\n```\n# in dataservices-api repo root path:\ncd server/lib/python/cartodb_services \u0026\u0026 pip install -r requirements.txt \u0026\u0026 sudo pip install . --upgrade\n```\n\nCreate a database to hold all the server part and a user for it:\n\n```\nCREATE DATABASE dataservices_db ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';\nCREATE USER dataservices_user;\n```\n\nInstall needed extensions in dataservices_db database:\n\n```\npsql -U postgres -d dataservices_db -c \"BEGIN;CREATE EXTENSION IF NOT EXISTS plproxy; COMMIT\" -e\npsql -U postgres -d dataservices_db -c \"BEGIN;CREATE EXTENSION IF NOT EXISTS plpythonu; COMMIT\" -e\npsql -U postgres -d dataservices_db -c \"BEGIN;CREATE EXTENSION IF NOT EXISTS cdb_dataservices_server; COMMIT\" -e\n```\n\n### b. Carto Data Services\n\nLogin to DB server\n\nMake the extension available in postgres:\n\n```\ncd /opt\ngit clone https://github.com/CartoDB/data-services.git\ncd data-services/geocoder/extension\nsudo make install\n```\n\nDownload the internal geocoder data:\n\n```\ncd /opt/data-services/geocoder\n./geocoder_dowload_dumps\n```\n\nOnce the data is downloaded, execute this command:\n\n```\n./geocoder_restore_dump postgres dataservices_db db_dumps/*.sql\n```\n\nInstall geocoder extension:\n\n```\ncd /opt/data-services/geocoder\nsudo make all install\n```\n\nInstall onto a CARTO user's database (it is mandatory to install it into a CARTO user's database)\n\n```\npsql -U development_cartodb_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f cartodb_dev_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f_db\nCREATE EXTENSION cdb_geocoder;\n```\n\n### c. Install data observatory extension\n\nBegin by logging out of the web server and login to your db server (if you're working with a 2 server configuration)\n\nMake the extension available in postgresql to be installed:\n\n```\ncd /opt\ngit clone https://github.com/CartoDB/observatory-extension.git\ncd observatory\nsudo make install\n```\n\nThis extension needs data, dumps are not available so we're going to use the test fixtures to make it work.\n\n```\npsql -U postgres -d dataservices_db -f src/pg/test/fixtures/load_fixtures.sql\n```\n\nGive permission to execute and select to the dataservices_user user:\n\n```\npsql -U postgres -d dataservices_db -c \"BEGIN;CREATE EXTENSION IF NOT EXISTS observatory VERSION 'dev'; COMMIT\" -e\npsql -U postgres -d dataservices_db -c \"BEGIN;GRANT SELECT ON ALL TABLES IN SCHEMA cdb_observatory TO dataservices_user; COMMIT\" -e\npsql -U postgres -d dataservices_db -c \"BEGIN;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA cdb_observatory TO dataservices_user; COMMIT\" -e\npsql -U postgres -d dataservices_db -c \"BEGIN;GRANT SELECT ON ALL TABLES IN SCHEMA observatory TO dataservices_user; COMMIT\" -e\npsql -U postgres -d dataservices_db -c \"BEGIN;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA observatory TO dataservices_user; COMMIT\" -e\n```\n\n### d. Configure Carto Server to use Data Services / Observatory\n\nLogin to DB Server\n\nEnter psql CLI for carto_db_production\n\n```\npsql -U postgres carto_db_production\n```\n\nRedis configuration\n\n```\nSELECT CDB_Conf_SetConf(\n    'redis_metadata_config',\n    '{\"redis_host\": \"localhost\", \"redis_port\": 6379, \"sentinel_master_id\": \"\", \"timeout\": 0.1, \"redis_db\": 5}'\n);\nSELECT CDB_Conf_SetConf(\n    'redis_metrics_config',\n    '{\"redis_host\": \"localhost\", \"redis_port\": 6379, \"sentinel_master_id\": \"\", \"timeout\": 0.1, \"redis_db\": 5}'\n);\n```\n\nUsers/Organizations\n\n```\nSELECT CDB_Conf_SetConf(\n    'user_config',\n    '{\"is_organization\": false, \"entity_name\": \"\u003cYOUR_USERNAME\u003e\"}'\n);\n```\n\nData Observatory\n\n```\nSELECT CDB_Conf_SetConf(\n    'data_observatory_conf',\n    '{\"connection\": {\"whitelist\": [], \"production\": \"host=localhost port=5432 dbname=dataservices_db user=geocoder_api\", \"staging\": \"host=localhost port=5432 dbname=dataservices_db user=geocoder_api\"}}'\n);\n\\q\n```\n\nUser database configuration\n\nUser (client) databases need also some configuration so that the client extension can access the server:\n\n```\npsql -U postgres cartodb_user_7747c61a-23a1-4ccc-a738-747e8ee24821_db\nSELECT CDB_Conf_SetConf('user_config', '{\"is_organization\": false, \"entity_name\": \"\u003cYOUR_USERNAME\u003e\"}');\n```\n\nThe geocoder_server_config (the name is not accurate for historical reasons) entry points to the dataservices server DB (you can use a specific database for the server or your same user's):\n\n```\nSELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=\u003cSERVER_DB_NAME\u003e user=postgres\"}');\n```\n\n### e. Update Cartodb configuration\n\nMake sure you are logged into the Web Server (if on a 2 server config)\n\nEdit the following session of /opt/cartodb/config/app_config.yml as below\n\n```\n  dataservices:\n    enabled:\n        geocoder_internal: true\n        hires_geocoder: false\n        isolines: false\n        routing: false\n        data_observatory: true\n```\n\nAdd the following entry to the geocoder entry of the cartodb/config/app_config.yml file: \n\n```\n  geocoder:\n    #force_batch: true\n    #disable_cache: true\n    api:\n      host: '10.128.0.7'\n      port: 5432\n      user: 'dataservices_user'\n      dbname: 'dataservices_db'\n```\n\nExecute the rake tasks to update all the users and organizations:\n\n```\ncd /opt/cartodb\nRAILS_ENV=production bundle exec rake cartodb:db:configure_geocoder_extension_for_non_org_users[username,all_users]\nRAILS_ENV=production bundle exec rake cartodb:db:configure_geocoder_extension_for_organizations[organization_name,all_organizations]\n```\n\nRestart Apache to make it effective.\n\n```\nsudo service httpd restart\n```\n\n# 4. Upgrade process for Carto components\n\nIn this next section, we will document the process of upgrading your Carto server components to new versions. The Carto team works on a \"continuous development\" basis, so updates are very frequently made to the platform. However, major releases are given tags in github, and important changes (and steps required for upgrade) are detailed in the release note history. Especially because versions change so often , you should take the following as an example of how to set up an upgrade and not strictly as a de facto process for your server.\n\n# 4.1 Check versions for currently installed Carto components:\n\nYou will need to know what versions of each component you installed originally. To test this, do the following:\n\nOn your web server:\n\n```\ncd /opt/cartodb\ngit describe --tags\n\ncd /opt/CartoDB-SQL-API\ngit describe --tags\n\ncd /opt/Windshaft-cartodb\ngit describe --tags\n\ncd /opt/dataservices-api\ngit describe --tags\n```\n\n\nOn your database server, check:\n\n```\ncd /opt/cartodb-postgresql\ngit describe --tags\n\ncd /opt/dataservices\ngit describe --tags\n\ncd /opt/observatory\ngit describe --tags\n```\n\nNow you have a collection of \"tags\" you can use to generate a list of updates required. Now make your way over to each github page for these components and check the current \"tag\" (note that some of these have multiple branches, especially the postgresql components, so be sure you're not accidentally downgrading).\n\nThe steps you need to take will be an aggregation of all details from each version increment detailed in the documentation for those components, also with the caveat that you're working with CentOS and not Ubuntu (see above for our suggestios on how to translate ubuntu packages into Centos etc.). \n\n- For the CartoDB application, see here: https://github.com/CartoDB/cartodb/blob/master/NEWS.md \n- For the Carto SQL API, see here: https://github.com/CartoDB/CartoDB-SQL-API/blob/master/NEWS.md\n- For Windshaft-CartoDB (the tiler and MAPS API), see here: https://github.com/CartoDB/Windshaft-cartodb/blob/master/NEWS.md\n- For Data Services API: https://github.com/CartoDB/dataservices-api/blob/master/NEWS.md\n\nAnd on your database server, components to check are:\n- https://github.com/CartoDB/cartodb-postgresql/blob/master/NEWS.md\n- https://github.com/CartoDB/observatory-extension/blob/master/NEWS.md\n- https://github.com/CartoDB/data-services/blob/master/NEWS.md\n\n# 4.2 On Web server\n### a. Upgrade CartoDB application\n\nStop Apache first\n```\nsudo service httpd stop\n```\n\nMake a backup of your current cartodb folder\n```\ncp -Rp /opt/cartodb /opt/cartodb.backup\n```\nNote. make sure you have enough space under /opt or you can choose a different location\n\nLogin as carto user: `su carto`\n\nCheck out the latest version from Office Github source\n```\ncd /opt/cartodb\ngit checkout master\ngit pull\n```\n\nInstall dependencies\n```\nexport PATH=$PATH:/usr/pgsql-9.5/bin/:/opt/rubies/ruby-2.2.3/bin\nRAILS_ENV=production bundle install --deployment --without development test\n```\n\nEdit package.json file and change the required version of grunt from 1.0.1 to 0.4.5\n```\nnano package.json\nChange \"grunt\": \"1.0.1\", to \"grunt\": \"0.4.5\",\n```\n\nNote: At the time of writing, in order to install grunt for Production without errors, we have to keep grunt at version 0.4.5. If you are using CartoDB in Development environment, you can skip this step.\n\nRun npm to install other dependencies\n```\nnpm install\n```\n\nInstall all necessary gems:\n```\nexport PATH=$PATH:$PWD/node_modules/grunt-cli/bin\nbundle exec grunt --environment production\n```\n\nRun following rake tasks\n```\nRAILS_ENV=production bundle exec rake db:migrate\nRAILS_ENV=production bundle exec rake cartodb:db:reset_trigger_check_quota\nRAILS_ENV=production bundle exec rake cartodb:db:load_functions\n```\n\nUpdate the postgresql extension:\n```\ncd /opt/cartodb/lib/sql/\nPGUSER=postgres make all install\n```\n\nRestart Apache\n```\nsudo service httpd start\n```\n\nNote: if you do a clean re-install for your upgrade process, you will need to re-create `/opt/cartodb/script/run_resque.sh` in order for the Windshaft application service to function properly (as per step 3.2.c above).\n\n### b. Upgrade Carto SQL API application\n\nStop SQL API service first\n```\nsudo service cartodb-sql stop\n```\n\nMake a backup of your current cartodb folder\n```\ncp -Rp /opt/CartoDB-SQL-API /opt/CartoDB-SQL-API.backup\n```\nNote. make sure you have enough space under /opt or you can choose a different location\n\nPreserve your carto-sql-api configuration file:\n```\ncp /opt/CartoDB-SQL-API/config/environments/production.js /tmp\n```\n\nOption 1: we have found in testing that it may be better to perform a fresh reinstall of the new version rather than upgrade in-line. If you'd like to do this, here are the steps:\n\n```\nsudo rm -fr CartoDB-SQL-API\ncd /opt\nsudo git clone https://github.com/CartoDB/CartoDB-SQL-API.git\nsudo chown -R carto Windshaft-cartodb\ncd /opt/CartoDB-SQL-API\nnpm install\nsudo cp /tmp/production.js /opt/CartoDB-SQL-API/config/environments/\nsudo chown carto:carto production.js\n```\n\nOption 2: Alternately, check out the latest version from Office Github source from within your existing direction:\n\n```\ncd /opt/CartoDB-SQL-API\ngit checkout master\ngit pull\n```\n\nStart SQL API service:\n```\nsudo service cartodb-sql start\n```\n\n### c. Upgrade Windshaft-CartoDB application\n\nStop windshaft service first\n```\nsudo service windshaft-cartodb stop\n```\n\nMake a backup of your current cartodb folder\n```\ncp -Rp /opt/Windshaft-cartodb /opt/Windshaft-cartodb.backup\n```\nNote: make sure you have enough space under /opt or you can choose a different location\n\nPreserve your windshaft configuration file:\n```\ncp /opt/Windshaft-cartodb/config/environments/production.js /tmp\n```\n\nOption 1: we have found in testing that it may be better to perform a fresh reinstall of the new version rather than upgrade in-line. If you'd like to do this, here are the steps:\n\n```\nsudo rm -fr /opt/Windshaft-cartodb\ncd /opt\ngit clone https://github.com/CartoDB/Windshaft-cartodb.git\nsudo chown -R carto Windshaft-cartodb\ncd Windshaft-cartodb\nnpm install\nsudo cp /tmp/production.js /opt/Windshaft-cartodb/config/environments/\nsudo chown carto:carto production.js\nmkdir /opt/cartodb/tile_assets/\ntouch /opt/Windshaft-cartodb/logs\n```\n\nOption 2: Alternately, check out the latest version from Office Github source from within your existing direction:\n\n```\ncd /opt/Windshaft-cartodb\ngit checkout master\ngit pull\n```\n\nStart Windshaft service\n```\nsudo service windshaft-cartodb start\n```\n\n# 4.3 On DB server\n\n### a. Upgrade Cartodb-postgresql\n\nCheck out the latest version from Office Github source\n```\ncd /opt/cartodb-postgresql\ngit checkout master\ngit pull\n```\n\nInstall the new extension\n```\nexport PATH=$PATH:/usr/pgsql-9.5/bin/:/opt/rubies/ruby-2.2.3/bin\nsudo env \"PATH=$PATH\" make all install\n```\n\nMake sure the new exensions are created\n```\nsudo su -l postgres\npsql -d carto_db_production\nCREATE EXTENSION IF NOT EXISTS plpythonu;\nCREATE EXTENSION IF NOT EXISTS postgis;\nCREATE EXTENSION IF NOT EXISTS cartodb;\n\\q\n```\n\n### b. Upgrade Observatory extension\nCheck out the latest version from Office Github source\n```\ncd /opt/observatory-extension\ngit checkout master\ngit pull\n```\nInstall the new extension\n```\nPGUSER=postgres sudo make install\n```\n\n### c. Upgrade dataservices-api\nCheck out the latest version from Office Github source\n```\ncd /opt/dataservices-api\ngit checkout master\ngit pull\n```\nInstall the new API\n```\ncd client \u0026\u0026 sudo make install\ncd -\ncd server/extension \u0026\u0026 sudo make install\n```\n\n### d. Upgrade data-services\nCheck out the latest version from Office Github source\n```\ncd /opt/data-services\ngit checkout master\ngit pull\n```\nInstall the new geocode extension\n```\nsudo make all install\n```\n\n# Notes\n\n[^1]: For more on this fix I've used here, see [http://unix.stackexchange.com/questions/83191/how-to-make-sudo-preserve-path](http://unix.stackexchange.com/questions/83191/how-to-make-sudo-preserve-path).\n\n[^2]: Credit goes to the following for the above step: [https://docs.npmjs.com/getting-started/installing-node](https://docs.npmjs.com/getting-started/installing-node)\n\n[^3]: Credit for the service files which I've hacked only lightly to produce what is in this guide goes to Javier Torres Niño \u0026lt;jtorres@carto.com\u0026gt;\\). I've drawn these from his arch-linux distribution which can be found here: [https://aur.archlinux.org/packages/?O=0\u0026SeB=n\u0026K=carto\u0026outdated=\u0026SB=n\u0026SO=a\u0026PP=50\u0026do\\_Search=Go](https://aur.archlinux.org/packages/?O=0\u0026SeB=n\u0026K=carto\u0026outdated=\u0026SB=n\u0026SO=a\u0026PP=50\u0026do_Search=Go). See also [http://cartodb.readthedocs.io/en/latest/configuration.html\\#separate-folders](http://cartodb.readthedocs.io/en/latest/configuration.html#separate-folders). Other documentation I've consulted for this section includes: [http://serverfault.com/questions/616430/why-isnt-systemctl-starting-redis-server-on-centos-7](http://serverfault.com/questions/616430/why-isnt-systemctl-starting-redis-server-on-centos-7) and [https://scottlinux.com/2014/12/08/how-to-create-a-systemd-service-in-linux-centos-7/](https://scottlinux.com/2014/12/08/how-to-create-a-systemd-service-in-linux-centos-7/).\n\n[^4]: Thanks to [http://serverfault.com/a/275411](http://serverfault.com/a/275411) for this answer. Though note that we've modified this for Britain. :\\)\n\n[^5]: Thanks to [http://unix.stackexchange.com/a/63068/94615](http://unix.stackexchange.com/a/63068/94615) for help with the section below.\n\n[^6]: Note: some of the details below have been drawn \\(with gratitude\\) from [http://www.unixmen.com/postgresql-9-4-released-install-centos-7](http://www.unixmen.com/postgresql-9-4-released-install-centos-7)\n\n[^7]: Thanks to [https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-a-centos-7-server](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-a-centos-7-server) for most of the below details for installing node.js on centos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapcomm%2Fmapping.community-carto_install_doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapcomm%2Fmapping.community-carto_install_doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapcomm%2Fmapping.community-carto_install_doc/lists"}