GithubHelp home page GithubHelp logo

shayan-taheri / web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from travelmapping/web

0.0 2.0 0.0 3.48 MB

Web-facing tool/page development

JavaScript 15.53% CSS 2.30% HTML 57.03% PHP 25.00% Hack 0.04% Shell 0.10%

web's Introduction

Web

Web-facing tool/page development

Setting up an instance of TM's DB and web front end

The server should be running an instance of MySQL server (5.7.22 as of this writing) and the apache web server (2.4.33 as of this writing). The web server needs to have PHP enabled (version 7.2.5 as of this writing) with the mysqli, ctype, and json extensions, and mod_php72 to get the loadable module. The remaining instructions assume apache, MySQL, and PHP are all working together properly. On FreeBSD, this involved installing the correct packages.

MySQL database

First, create the users needed for the database. Connect and authenticate as root to the MySQL server. Create passwords for an account that will have permission to administer the TM database that will be used for DB updates and an account that will have only read permission that will be used by the web front end. In the example below, these use the TM default names "travmapadmin" and "travmap".

CREATE USER 'travmapadmin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOURPASSWORDFORTHISUSER';
CREATE USER 'travmap'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOURPASSWORDFORTHISUSER';

To be able to update the DB remotely by ssh, a file ~/.my.cnf can be created on the server with the password for travmapadmin:

[clienttmapadmin]
password = YOURPASSWORDFORTHISUSER

Be sure the permissions are 600, so only readable by the user.

Next, we create the database and give these users needed permissions.

CREATE DATABASE TravelMapping;
GRANT SELECT ON `TravelMapping`.* TO 'travmap'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, REFERENCES ON `TravelMapping`.* TO 'travmapadmin'@'localhost'

If you have a TravelMapping.sql file (generated by the site update process), you can now try to use it to populate the TravelMapping database.

mysql --defaults-group-suffix=tmapadmin -u travmapadmin TravelMapping < TravelMapping.sql

Normally, the above will be run as part of the site update process but it is done here as a way to test the database setup.

Web server files

The files in this Web repository should be placed in a directory served by the web server. We assume /home/www/tm and a vhosts entry that Apache uses to direct a URL to use files from this location. The updateserver.sh can help populate and later update this directory. Note that the fonts directory is not updated by this script, and those files will need to be transferred separately.

In addition to the files in the repository, the file lib/tm.conf needs to be created. This file contains eight lines:

Line 1: DB name (likely TravelMapping)
Line 2: DB read-only user (likely travmap)
Line 3: DB read-only user password
Line 4: DB hostname (likely localhost)
Line 5: HERE map id
Line 6: HERE map code
Line 7: ThunderForest map key
Line 8: MapBox token

This file needs to be readable by the web server but should not be served by the web server. Configure Apache to ensure this.

Also create a file motd in the root of the directory server. This is the "message of the day" for TM.

Finally, create a directory named cache in the shields directory. This needs to be writable by the web server.

Now test it out. Hopefully everything will work!

web's People

Contributors

cftarbay avatar compdude avatar duke87ofst avatar jteresco avatar mapcat avatar markkos1992 avatar michihdeu avatar ntallyn avatar ovoss avatar rmihailucian avatar rschen7754 avatar sammdot avatar si404 avatar the-spui-ninja avatar thefxexpert avatar wjorda avatar yakra avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.