Main Menu

search

You are here

obs - Drupal: Local Server Setup

as of 2024-01-04 this page may be obsolete...
---------------------------
[last updated: 2020-01-04]
Drupal home page
obs - local server installation
https://www.drupal.org/docs/official_docs/local-development-guide
-----

Bottom line:

    This page is a rambling, incomplete blog of my process. The process to date has been unsuccessful, so this is a minimal study guide and not at all a workable procedure.

-----------------------------------------------------------

  • Now I have to figure out how to get all my sites set up...
  • At this time, I have installed drupal into /var/www/html/drupal769
    This is my root installation folder
    In ../sites sub directory, I created folders for all my domains, starting with jayrabe.net
    • I think this configuration is called "subdirectory multi-site."
      Alternatively, you could use "sub-domains" which are a service of most hosting sites, in which case your subdomain would have a URL like: sub-domain.main-site
  • (from O'Reilly) I copied ../sites/default/default.settings.php into ../sites/jayrabe.net, and renamed it settings.php
    BUT later:after drupal was set up on drupal769, I copied /default/settings.php into jayrabe.net,
    then edited it to change name of database etc...
    [recommendation from elsewhere to set chmod 644 for the settings.php file]
  • I will have separate databases for each of my sites;
    the home site drupal769 has "drupal" database
    jayrabe.net will have "jayrabeNetDB" database
    • $ sudo mysql -u root2 -p
      mysql> create database jayrabeNetDB;
  • from (link to:) drupal.org:
    • "Adjust the permissions of the new site directory to grant write permissions to the configuration file (settings.php).
      $ sudo chmod 777 /var/www/html/drupal769/sites/jayrabe.net
    • "Create a files directory in ../sites/jayrabe.net and allow the webserver write permissions to it":
      • $ cd /var/www/html/drupal769/sites/jayrabe.net
      • $ sudo mkdir files
      • $ sudo chmod 777 files ... not sure which user category the "webserver" is in, so gave all privs to everyone ...
        [elsewhere recommended chmod 755]
    • "In drupal7, there is no need for sites.php file unless you need (link to:) "site aliasing" feature. "
    • Create symlinks for each site directory (you can alternatively use "aliases in the webserver configuration...")
      $ cd /var/www/drupal769
      $ sudo ln -s . jayrabe.net
      This created a jayrabe.net link icon in drupal769 root folder
      loading localhost/drupal769/jayrabe.net ... takes me to drupal769 home page ... ?
    • copied sites/default/settings.php into jayrabe.net to replace the settings file that was there that was copied from default.settings.php ... then:
      $ sudo nano /var/www/drupal769/sites/jayrabe.net/settings.php
      found lines related to the database, and entered new values for the databaseName: jayrabeNetDB, user: JRNadmin, pw: JRNttt.
    • However: opening localhost/drupal769/jayrabe.net still took me to drupal769 home page with no option to re-install for my new site...
    • $ sudo cp -avr /var/www/html/drupal769/install.php /var/www/html/drupal769/sites/jayrabe.net/install.php
      [lost track of things ... may have done this before re-doing the settings file above ... in any case have renamed/disabled the install.php file for now ...]
    • somewhere along the line I got a warning/error that said to:
      edit settings.php (in jayrabe.net)
      • find the line:
        $update_free_access = FALSE;
        change it to TRUE
      • run the update.php script:
        forums suggest I do this in a browser opened to: localhost/drupal769/jayrabe.net/update.php
        which implies that update.php is in fact IN jayrabe.net...
      • change free_access back to FALSE

    • Have not done this yet ... see below ...

    ---------------------

  • But first, I'll go back and retry the install.php from inside jayrabe.net:
    • renamed/enabled install.php ...
      localhost/drupal769/jayrabe.net/install.php ... said already installed
      localhost/drupal769/sites/jayrabe.net/install.php ... locked up
    • went back and removed jayrabe.net/settings.php and replaced with (renamed) copy from default/default.settings.php
      No change: localhost/drupal769/jayrabe.net/install.php ... said already installed
      localhost/drupal769/sites/jayrabe.net/install.php ... locked up

    -----

  • meanwhile...
    saw note to check privileges:
    mysql> show grants for 'JRNadmin'@'localhost';
    showed I had USAGE grants only on jayrabeNetDB
    and in fact I could not log into it with: $ sudo mysql -u JRNadmin -p jayrabeNetDB
    SO:
    mysql> grant all privileges on jayrabeNetDB.* to 'JRNadmin'@'localhost'
    now I can log in ... and retrying...
    No change ...
  • localhost/drupal769/update.php
    executed ... said to put site into maintenance mode first ... closed browser
    localhost/drupal769 - configuration - Development - Maintenance Mode - check box - save configuration
    ... close maintenance mode window ...
  • localhost/drupal769/update.php
    continue
    no pending updates
    return to: localhost/drupal769
    click go online
    un-check maint mode
    save config
    site restored
  • copied /drupal769/sites/example.sites.php to sites/sites.php
    edited and added at end:
    $sites['localhost.drupal769/jayrabe.net'] = 'jayrabe.net';

    localhost/drupal769/jayrabe.net/install.php
    says to edit settings.php, which I had reverted to default...

    restoring edited version...
    no joy

    restart apache
    -----------------------------------------------------------------

  • Links:

.

.

.

eof