Skip to content

This is a Drupal 8 sample project that's use NASA api to import exoplanets data.

Notifications You must be signed in to change notification settings

yuriseki/nasa-api-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation Instructions

Considering you're using Ubuntu and LAMP Server.

  1. Download the project into the web server folder ex./var/www/html/uaf.
  2. Set the permissions for the files folder accordingly to the web server you're using.
sudo mkdir /var/www/html/uaf/docroot/sites/default/files
sudo chown www-data:$USER /var/www/html/uaf/docroot/sites/default/files -R
  1. Create the site config file on apache.
sudo nano /etc/apache2/sites-available/dev.uaf.conf
  1. Paste the following content on dev.uaf.conf file
<VirtualHost *:80>
    ServerName dev.uaf
    
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/uaf/docroot
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
  1. Activate the site.
sudo a2ensite dev.uaf.conf
sudo service apache2 restart
  1. Register the UAF site on the hosts file by adding 127.0.0.1 dev.uaf at the end of the file.
sudo nano /etc/hosts 
  1. Create a database for the UAF site.
mysql -u root -p
CREATE SCHEMA `uaf` DEFAULT CHARACTER SET latin1;
CREATE USER 'uaf'@'localhost' IDENTIFIED BY 'YOUR PASSWORD';
GRANT ALL PRIVILEGES ON uaf.* TO 'uaf'@'localhost';

exit;
  1. Install the Drupal site using drush.
cd /var/www/html/uaf/docroot
sudo cp sites/default/default.settings.php sites/default/settings.php
sudo chown www-data:$USER sites/default/settings.php
drush si standard --db-url=mysql://uaf:'YOUR PASSWORD'@localhost/uaf

Take notes of your username and password.

  1. Adjust the config folder on dorcroot/default/settings.php
nano docroot/sites/default/settings.php

Replace the last line (Something like:)

$config_directories['sync'] = 'sites/default/files/config_tkFzoCY46CuHdBVEcgWs7LI9ZSMoqEH_DtzGjcRpKCG6euyT_QVwRoNEel0JzO91surASw5nWA/sync';

by the following:

$config_directories = [
  CONFIG_SYNC_DIRECTORY => '../config/default',
];
  1. Change your site UUID to be able to import the configuration.
drush config-set "system.site" uuid "653059e0-5618-4625-9969-ba298fa6acf5"
  1. Import the site configuration.
drush sqlq "truncate table shortcut"
drush cim
  1. Load the exoplanets data from NASA (Optional at this moment).
drush cc drush
drush cr
drush import-exoplanets
  1. Access the UAF local website using your browser.
http://dev.uaf

About

This is a Drupal 8 sample project that's use NASA api to import exoplanets data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published