Skip to content

Commit 97832c8

Browse files
committed
vagrant config
1 parent 3f3fd48 commit 97832c8

File tree

5 files changed

+72
-11
lines changed

5 files changed

+72
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vagrant
2+
*.log

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
A php based webservice for GPS tracking with Google Maps integration
33
========
44

5-
Version 1.0.1
6-
75
www.mikelduke.com
86

97

@@ -15,6 +13,7 @@ http://getbootstrap.com/
1513

1614
Get a Google Maps API Key:
1715
https://developers.google.com/maps/signup
16+
https://developers.google.com/maps/documentation/embed/get-api-key
1817

1918
*******************************************************************************
2019

@@ -30,7 +29,8 @@ https://developers.google.com/maps/signup
3029
* Can have multiple users to admin the system
3130
* Users can easily add new gps points either through the admin interface or using any external client capable of making HTTP GET requests.
3231
* On Android, it is simple to create a task using the app [Tasker](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en) to generate the requests as desired.
33-
* To embed on a webpage: <iframe src="view.php" height="520" width="520" seamless></iframe>
32+
* To embed on a webpage:
33+
```<iframe src="view.php" height="520" width="520" seamless></iframe>```
3434

3535
Example Update URL:
3636
http://yoursite.com/phpGPS/addGpsEntry.php?key=1234&newEntry=Y&gps_devicename=DeviceID&gps_type_id=1&gps_path_id=1&gps_date_dt=11-13-2014&gps_date_time=22.31&gps_status=&gps_latitude=32&gps_longitude=-96&gps_altitude=160.0&gps_accuracy=57&gps_name=test%20spot&gps_comment=test%20comment&gps_address1=address%201&gps_address2=address%202&gps_address3=address%203&gps_city=city&gps_zipcode=567567&gps_state=state&gps_country=country
@@ -42,17 +42,24 @@ Example Update URL:
4242

4343

4444
## Requirements
45-
* php 5
45+
* php 5+
4646
* MySQL
4747
* Webserver
4848

4949

5050
## Install Instructions
5151
1. Extract php files to webhost
52-
2. Download bootstrap and extract to phpGPS/bootstrap
53-
3. Create Database for use by phpGPS
54-
4. Enter database settings and other config in phpGPS_Settings.php
55-
5. Open phpGPS/install/install.php in browser to create the necessary tables
56-
6. Delete the install folder on webhost
57-
7. Login as user admin/admin and change the default admin pass
58-
8. Set up owners, devices, paths, etc as desired and start creating markers
52+
1. Create Database for use by phpGPS
53+
1. Enter database settings and other config in phpGPS_Settings.php
54+
1. Open phpGPS/install/install.php in browser to create the necessary tables
55+
1. Delete the install folder on webhost
56+
1. Login as user admin/admin and change the default admin pass
57+
1. Set up owners, devices, paths, etc as desired and start creating markers
58+
59+
# Demo VM
60+
Requires Vagrant + VM Provider like VirtualBox + Google Maps API Key
61+
* Clone this repo and make sure .sh files use unix line endings LF
62+
* Set API Key in phpGPS_Settings.php
63+
* Run ```vagrant up```
64+
* Connect at http://localhost
65+
* Login with user/password: admin/admin

Vagrantfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
5+
NODE_IP = "172.17.4.99"
6+
NODE_VCPUS = 2
7+
NODE_MEMORY_SIZE = 2048
8+
9+
Vagrant.configure("2") do |config|
10+
config.vm.box = "ubuntu/bionic64"
11+
12+
config.vm.provider :virtualbox do |v|
13+
v.cpus = NODE_VCPUS
14+
v.gui = false
15+
v.memory = NODE_MEMORY_SIZE
16+
end
17+
18+
config.vm.network :private_network, ip: NODE_IP
19+
config.vm.network :forwarded_port, guest: 80, host: 80
20+
21+
config.vm.provision :shell, path: "vagrant-install.sh"
22+
23+
config.vm.synced_folder "src/", "/var/www/html/"
24+
end

default-env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export PHPGPS_DEV_KEY=""
2+
export PHPGPS_DB_HOSTNAME="localhost"
3+
export PHPGPS_DB_NAME="phpgps"
4+
export PHPGPS_DB_USER="phpgps"
5+
export PHPGPS_DB_PASS="phpgps"

vagrant-install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
source /vagrant/default-env.sh
4+
5+
apt-get update
6+
apt-get install -y curl apache2 git mysql-server \
7+
php-pear php-fpm php-dev php-zip php-curl php-xmlrpc \
8+
php-gd php-mysql php-mbstring php-xml libapache2-mod-php
9+
10+
sudo service apache2 restart
11+
12+
usermod -aG www-data vagrant
13+
14+
php -r 'echo "\n\nPHP Installed.\n\n\n";'
15+
16+
sudo mysql -e "create database $PHPGPS_DB_NAME; GRANT ALL PRIVILEGES ON $PHPGPS_DB_NAME.* TO $PHPGPS_DB_USER@localhost IDENTIFIED BY '$PHPGPS_DB_PASS'"
17+
18+
cd /vagrant/src/install
19+
php -f install.php
20+
21+
echo ''
22+
echo 'mysql setup complete'
23+
echo ''

0 commit comments

Comments
 (0)