Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing instructions #2258

Open
tpluscode opened this issue Jul 7, 2021 · 2 comments
Open

Testing instructions #2258

tpluscode opened this issue Jul 7, 2021 · 2 comments

Comments

@tpluscode
Copy link
Contributor

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?

@Kibubu
Copy link
Contributor

Kibubu commented Dec 9, 2021

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>

@davidlehn
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants