Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt-get update -qq
- sudo apt-get install -y build-essential cmake g++ libboost-dev libboost-system-dev \
- libboost-filesystem-dev libexpat1-dev zlib1g-dev libxml2-dev\
- libbz2-dev libpq-dev libproj-dev \
- postgresql-server-dev-10 postgresql-10-postgis-2.4 \
- postgresql-contrib-10 \
- apache2 php php-pgsql libapache2-mod-php php-pear php-db \
- php-intl git
- export USERNAME=ubuntu
- export USERHOME=/home/ubuntu/nominatim
- export NOMINATIM_SOURCE_DIR=$USERHOME/Nominatim-3.2.0
- export APACHE_BASE_DIR=$NOMINATIM_SOURCE_DIR/build/website
- mkdir nominatim
- # create 32GB swap file
- sudo dd if=/dev/zero of=/swapfile bs=1G count=32
- sudo chmod 600 /swapfile
- sudo mkswap /swapfile
- sudo swapon /swapfile
- sudo tee -a /etc/fstab << EOFFSTAB
- /swapfile swap swap defaults 0 0
- EOFFSTAB
- # postgresql
- sudo tee -a /etc/postgresql/10/main/postgresql.conf << EOFPOSTGRESCONF
- # settings for 32GB memory
- shared_buffers = 2GB
- maintenance_work_mem = 10GB
- work_mem = 50MB
- effective_cache_size = 24GB
- synchronous_commit = off
- #checkpoint_segments = 100 # only for postgresql <= 9.4
- checkpoint_timeout = 10min
- checkpoint_completion_target = 0.9
- fsync = off
- full_page_writes = off
- EOFPOSTGRESCONF
- sudo systemctl restart postgresql
- sudo -u postgres createuser -s $USERNAME
- sudo -u postgres createuser www-data
- # apache
- sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF
- <Directory "$APACHE_BASE_DIR">
- Options FollowSymLinks MultiViews
- AddType text/html .php
- DirectoryIndex search.php
- Require all granted
- </Directory>
- Alias /nominatim $APACHE_BASE_DIR
- EOFAPACHECONF
- sudo a2enconf nominatim
- sudo systemctl restart apache2
- # nominatim
- cd $USERHOME
- wget https://nominatim.org/release/Nominatim-3.2.0.tar.bz2
- tar xf Nominatim-3.2.0.tar.bz2
- cd Nominatim-3.2.0
- mkdir build
- cd build
- cmake ..
- make
- tee settings/local.php << EOF
- <?php
- @define('CONST_Website_BaseURL', '/nominatim/');
- @define('CONST_Osm2pgsql_Flatnode_File', '$USERHOME/flatnode.file');
- EOF
- touch $USERHOME/flatnode.file
- # load auxiliary data
- cd $NOMINATIM_SOURCE_DIR/data
- wget https://www.nominatim.org/data/wikipedia_article.sql.bin
- wget https://www.nominatim.org/data/wikipedia_redirect.sql.bin
- wget https://www.nominatim.org/data/gb_postcode_data.sql.gz
- # ingest geodata
- cd $NOMINATIM_SOURCE_DIR/build
- # whole planet
- wget https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
- ./utils/setup.php --osm-file planet-latest.osm.pbf --all --osm2pgsql-cache 24000 2>&1 | tee setup.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement