Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Instructions for Linux #27

Open
jillson opened this issue Sep 20, 2013 · 10 comments
Open

Build Instructions for Linux #27

jillson opened this issue Sep 20, 2013 · 10 comments
Assignees

Comments

@jillson
Copy link
Collaborator

jillson commented Sep 20, 2013

Update install instructions for use on machines other than Macs, specifically RH / RH variants where OpenGeo provides a yum repo with postgres/postgis/geoserver and other dependencies (gdal/geos/etc)

@ghost ghost assigned jillson Sep 20, 2013
@jillson
Copy link
Collaborator Author

jillson commented Sep 20, 2013

Question:
On Linux, I normally do my postgres admin actions using the postgres account versus making another user account have admin privileges. I noticed on your mac instructions, you just have them use the paver commands. Is this correct that on the Mac (especially since you probably installed it with your user account), this will work without having to do something like sudo su postgres paver create_db?

@jaycrossler
Copy link
Owner

Correct - on Mac, the 'paver' commands works from the user account without needing sudo.

@jillson
Copy link
Collaborator Author

jillson commented Sep 20, 2013

I'll check this in tomorrow-ish, but here's the process I followed tonight to build on my Fedora 18 workstation at home. Note that I did not actually configure geoserver; I was expecting this to pull in tomcat as a dependency and install stuff there, but this just pulled down a geoserver directory. Looking at the repo, I think I also want at least opengeo-server and/or opengeo-tomcat. Anyways, in case anyone wants to either verify my instructions or at least use them to bootstrap getting started:

Linux (specifically Red Hat and derivatives (e.g. CentOS / RHEL / Fedora))
(Note that Ubuntu/Debian should be rather similar using apt-get instead of yum but these have only been tested on Fedora 18 at the moment)

  1. Opengeo.org has a yum & apt repository with many of the dependencies pre-packages as Redhat Package Modules (RPM) and Debian/Ubuntu APT files. See http://repo.opengeo.org/suite/releases/community/docs/Op
    enGeoSuite-2.4.1-README-linux.txt for more details. For Fedora 18, run wget http://yum.opengeo.org/prod/test/suite/v4/fedora/18/x86_64/OpenGeo.repo (or http://yum.opengeo.org/prod/test/suite/v4/fedora/18/i6
    86/OpenGeo.repo if using 32bit Fedora) and add that repo file to your /etc/yum.repos.d directory to add the OpenGeo repository.
  2. sudo yum install geoserver (note that this may also download dependencies depening on what other packages you currently have installed). As of the time of this writing, this is geoserver 2.4.0-1.
  3. sudo yum install postgis21-postgresql93 (this will pull in the PostGis 2.1 from for postgresql9.3 OpenGeo instead of the older PostGis 1.5 which is the current Fedora 18 version); this should also pull in
    some dependencies
  4. sudo yum install postgresql93-server (which should also install postgresql93)
  5. sudo yum install postgresql93-devel
  6. sudo /sbin/service postgresql-9.3 initdb # to initialize db
  7. sudo chkconfig postgresql-9.3 on # to make postgres run on reboots
  8. Follow the steps similar to above for Mac installation to build the virtual env for geoq-django
    % export PATH=$PATH:/usr/pgsql-9.3/bin
    % mkdir -p ~/pyenv
    % virtualenv --no-site-packages ~/pyenv/geoq
    % source ~/pyenv/geoq/bin/activate
    % cd ~/penv/geoq
    % git clone [repo location]
    % cd [repo-name]
    % pip install paver
    % paver install_dependencies

Unfortunately, at least with my default configuration where my user account does not have postgresql admin permissions, the paver createdb / create_db_user commands don't work out of the box. Instead:
% sudo su - postgres
% export PATH=$PATH:/usr/pgsql-9.3/bin
% dd if=/dev/random bs=16 count=1 | base64 #or however you want to generate a password
% createdb geoq_django (or whatever you have in settings.py)
% echo "CREATE EXTENSION postgis;CREATE EXTENSION postgis_topology" | psql -d geoq_django
% psql -d geoq_django -c "CREATE USER geoq_user WITH PASSWORD 'gHTzUJEaDt6Sl5yWdSV';"
% with your text editor of choice edit ~postgres/9.3/data to add the line ABOVE the line for host all all

host geoq_django geoq_user 127.0.0.1/32 md5

    % exit (to leave postgres)
    % sudo /sbin/service postgresql-9.3 restart
    % paver sync
  1. If you would like to load development fixtures:
    % paver install_dev_fixtures # creates an admin/admin superuser
  2. Build user accounts
    % python manage.py createsuperuser
  3. Install lessc
    % sudo yum install lessjs
  4. Startup
    % paver start_django

@jillson jillson closed this as completed Sep 20, 2013
@jillson jillson reopened this Sep 20, 2013
@jillson
Copy link
Collaborator Author

jillson commented Sep 20, 2013

Also... would it make sense to build a VM with all of this baked in (to support Windows users and others who don't want to have to setup their own environment), and as I tweeted, any idea if there's something we could get to host that?

@jaycrossler
Copy link
Owner

It definitely would - we would love to have someone build one. Possibly as an Amazon AMI? Or a Heroku build?

@garnertb
Copy link
Collaborator

I'm +1 for creating a VM. I can run an Amazon box (and host the VM) from my account over the weekend if it would be helpful for Saturday.

@jillson
Copy link
Collaborator Author

jillson commented Sep 21, 2013

I'm looking at building on Heroku but won't have that ready for hackathon; if someone else wants to take it on, go right ahead.

Also: I found that:
A) I had to break down and grant the django_user POSTGRES super_user privs to make the test_django_db behaviors work. Will comment that accordingly when I update the notes

B) I also had to install proj4-dev as otherwise libproj4.so wasn't found, which caused the polygon editting to fail in a completely unhelpful way.

@jillson
Copy link
Collaborator Author

jillson commented Oct 3, 2013

Random notes from redoing this on a CentOS 6.4 VM:
For CentOS, needed to install easy_install and then use that to get virtualenv (virtualenv then installs pip inside when you create it).

@jaycrossler
Copy link
Owner

This issue should be merged into the chef scripts/vagrant system.

@jackiekazil
Copy link
Collaborator

@jaycrossler -- what is the status of this issue?

Is seems that maybe the CentOS instructions should be built into the wiki for geoq?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants