Thursday, May 12, 2016

-c amd64 X200: Installation for Drupal 8.

Hi,

It's been quite some time. I'm busy with day's work. Ah and also my X200's battery just died. So it's immobile. It's just docked and that's it. Replacement battery or "new" thinkpad (I always buy used anyway.), I'm not sure. But not now.

Ok back to the latest project/test I'm going to do. Drupal 8 has been released, I know I'm a bit late, and it's an interesting update. So I really want to install it. Take note that I'm installing this, after I installed Drupal 7. So nearly all of the dependencies are already there. You might want to (re)visit my previous post on this at http://karlbsd.blogspot.my/2015/08/openbsd-58-c-amd64-httpd-postgresql.html.

Recap, this is httpd + Drupal 8 + PostgreSQL.

1) Download Drupal 8.
I head over to http://www.drupal.org and download the latest stable version 8.1.1 which is drupal-8.1.1.tar.gz.

2) Extract file and move to htdocs.
I tar the downloaded drupal-8.1.1.tar.gz and rename the directory to drupal8 while moving it to /var/www/htdocs.

$ tar zxvf drupal-8.1.1.tar.gz
$ mv drupal-8.1.1 /var/www/htdocs/drupal8

3) Prepare the local hostname.
This Drupal, like the previous version, will only be a local testing environment. I also have a few *.example.com sites here, a plain php site, some drupal 7 site so I need to have another local hostname. I'm choosing drupal.example.com as my Drupal 7 site will now have drupal7.example.com instead. For that, I edited 2 files, /etc/hosts and /etc/httpd.conf.

$ vi /etc/hosts

===== /etc/hosts starts =====
127.0.0.1    drupal.example.com
===== /etc/hosts ends =====

$ vi /etc/httpd.conf

===== /etc/httpd.conf starts =====
server "drupal.example.com" {
    listen on $ext_addr port 80

    directory {
        index "index.php"
    }

    location "*.php*" {
        fastcgi socket "/run/php-fpm.sock"
    }

    root "/htdocs/drupal8"
}
===== /etc/httpd.conf ends =====

4) Drupal 8 installation.
Now is the good stuff. After I restart (restarting httpd is also ok), I fire up my browser and type "drupal.example.org" and Drupal 8 installation page is displayed. Nice!.


At the Choose language page, I just choose the default English and click Save and continue.

Choose profile, I choose Standard and click Save and continue.

Verify requirements, I was shown a warning and 2 errors. I'll show what I've done to resolve the warning/errors.

PHP OPcode cachingNot enabled
PHP OPcode caching can improve your site's performance considerably. It ishighly recommended to haveOPcache installed on your server.

In OpenBSD 5.8 and newer, and -Current, the opcache.so is readily available. It's just that it's not included in /etc/php-5.6.ini. So I edited /etc/php-5.6.ini. My changes is in bold.

===== /etc/php-5.6.ini starts =====
* other sections skipped *

engine = On

* other sections skipped *

; zend.script_encoding =

; This is for Drupal 8
zend_extension=/usr/local/lib/php-5.6/modules/opcache.so

===== /etc/php-5.6.ini ends =====

And after restarting, the warning is gone.


File systemWritable (public download method)
The directory sites/default/files does not exist. An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.
For this one, it's just that I create a files directory inside /sites/default. Then I chown the directory to www:www.

$ cd /var/www/htdocs/drupal8/sites/default
$ mkdir files
$ chown www:www files


Settings fileThe Settings file does not exist.
The Drupal installer requires that you create a ./sites/default/settings.php as part of the installation process. Copy the./sites/default/default.settings.php file to./sites/default/settings.php. More details about installing Drupal are available inINSTALL.txt.
This error is telling me that I haven't edited a settings.php file yet. So I need to copy the default.settings.php file to settings.php file.

$ cd /var/www/htdocs/drupal8/sites/default
$ cp default.settings.php settings.php
$ vi settings.php

===== settings.php starts =====
* other sections skipped *

/ **
* Database settings
* bla bla bla
*/
$database['default']['default'] = array(
    'driver' => 'pgsql',
    'database' => 'drupal',
    'username' => 'drupal',
    'password' => 'mypassword',
    'host' => 'localhost',
    'prefix' => '',
);

* other sections skipped *
===== settings.php ends =====

Take note that I have an existing Drupal 7 installation using the same database information. Exactly the same setting.

Then I click "try again" link at the bottom of the page.

Then the Database configuration page opens up.

Database configuration

Database type
 
 


I key in my Database password, then click Save and continue. Then I received an error stating that Drupal already been installed. Sheesh.

I dropped the previous drupal database in PostgreSQL, keeping the drupal username. Then I createdb a new drupal database. Please check your INSTALL.pgsql.txt file for details. Also I deleted the settings.php and copy default.settings.php to settings.php without changing anything. Just making sure the file is read/writable.

Then I restarted the Drupal installation again, and the installation went through.


On the configuration page, I just put the needed info and click Save and continue.

Drupal proceed to install. And after installing I can see the main page. Yeah!. Being amazed, I clicked on Content to start exploring and.. Error 404, Page not found. Ouch. Every other links gave the same error.

So I search the trusty-ol-internet, and found that this is related to Clean URL and mod_rewrite which unfortunately, users of OpenBSD's httpd can't use right now. Ouch. Again. I'm searching for anything relevant, maybe I'll try to disable the Clean URL thingy. But for now, I do know that Drupal 8 installation can go through. Later.

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...