perma-id/w3id.org

Testing instructions

tpluscode opened this issue · 2 comments

The readme calls to "test your changes with a local checkout of the site."

What is the easiest way to do that?

I would propose a dockerised local setup to easily spin up a server so that I can curl some requests and see if my .htaccess does what I expect.

I tried setting up Apache with lando but that didn't really work, likely because I don't know how to write that http.conf.

Any suggestions?

Did you set AllowOverride All for your directory and enabled the rewrite module?

Additionally you can also add logging of the rewrite module

Those are the lines I changed for testing (httpd.conf from docker httpd:latest)

...
LoadModule rewrite_module modules/mod_rewrite.so
...
LogLevel warn rewrite:trace8
...

<Directory "/usr/local/apache2/htdocs">
...
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    # AllowOverride FileInfo
    AllowOverride All
...
</Directory>

I had just mentioned a config over in #2431 (comment). You do have to get rewrite and maybe other mods loaded. The site config can be fairly simple for basic testing. There's probably a nice way to easily use this with docker.

<VirtualHost *:80>
   ServerName w3id.localhost
   DocumentRoot /whatever/w3id.org
   ErrorLog ${APACHE_LOG_DIR}/w3id.localhost-error.log
   CustomLog ${APACHE_LOG_DIR}/w3id.localhost-access.log "%h %l %u %t \"%r\" %>s %b"
   Header always set Access-Control-Allow-Origin "*"
   <Directory /whatever/w3id.org>
      Options FollowSymLinks
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>

If anyone wants to add a patch to improved docs on testing methods, please do.