Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Conversation

AndyHee
Copy link
Contributor

@AndyHee AndyHee commented Nov 12, 2018

Add Nginx configuration line

Add Nginx configuration line
@MrPetovan
Copy link
Collaborator

MrPetovan commented Nov 12, 2018

Thanks for your contribution, what about URL rewriting? On Apache it is taken care of by the .htaccess file in public/ but it won't be picked up by nginx.

@MrPetovan MrPetovan added the enhancement New feature or request label Nov 12, 2018
@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 12, 2018

I'm not sure I understand the issue. I have this line:

  # rewrite to front controller as default rule
  location / {
    rewrite ^/(.*) /index.php?q=$uri&$args last;
  }

Does that make sense?

@MrPetovan
Copy link
Collaborator

Not using nginx, I'd be unable to tell, but if it works for you then it should be ok.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 12, 2018

Ahh.. There is actually an issue. Compare this:
https://dir.hubup.pro/search?q=art
https://dir.friendica.mrpetovan.com/search?q=art

@MrPetovan
Copy link
Collaborator

Indeed. Looking into the Apache rewriting, it turns out there's no translation from the URI to a query string. The q=$uri may be extraneous in your example.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 12, 2018

It's a puzzle everything works apart from the tag search. Compare:

https://dir.hubup.pro/search?q=linux
https://dir.hubup.pro/search?field=country&q=United%20Kingdom

I've read his nginx page https://www.nginx.com/blog/creating-nginx-rewrite-rules/ but I don't know what I'm looking for.

Do you have any idea what is is not rewritten?

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 12, 2018

Error log output

2018/11/12 23:36:32 [error] 2588#2588: *82128 FastCGI sent in stderr: "PHP message: Slim Application Error:
Type: PDOException
Code: HY000
Message: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list
File: /var/www/directory/vendor/atlas/pdo/src/Connection.php
Line: 138
Trace: #0 /var/www/directory/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute()
#1 /var/www/directory/vendor/atlas/pdo/src/Connection.php(186): Atlas\Pdo\Connection->perform('SELECT p.`id`, ...', Array)
#2 /var/www/directory/src/classes/Models/Profile.php(99): Atlas\Pdo\Connection->fetchAll('SELECT p.`id`, ...', Array)
#3 /var/www/directory/src/classes/Controllers/Web/Search.php(76): Friendica\Directory\Models\Profile->getListForDisplay(20, 0, 'AND MATCH (p.`n...', Array)
#4 /var/www/directory/src/classes/Routes/Http/Search.php(28): Friendica\Directory\Controllers\Web\Search->render(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 [internal function]: Friendica\Directory\Routes\Http\S" while reading response header from upstream, client: 171.6.204.7, server: dir.hubup.pro, request: "GET /search?q=art HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "dir.hubup.pro", referrer: "https://dir.hubup.pro/"

@MrPetovan
Copy link
Collaborator

Arg, I found the issue. I got this error before so I quickly updated the schema on my database but I didn’t reflect the change in the migration script.

@MrPetovan
Copy link
Collaborator

Please update to the latest master, I won't push a release until I can make a proper project archive.

@MrPetovan
Copy link
Collaborator

New release v2.0.4 pushed, I changed the INSTALL instructions, which makes conflicts with your changes.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 13, 2018

Well done, Hypolite! Glad you found it. Thanks!

I'll update to the new release this evening, test the nginx configuration again, and resolve the conflict.

Also I'll be adding some tags to my profile soon too. ^-^

@MrPetovan
Copy link
Collaborator

Do you plan to add the nginx rewrite rule?

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 13, 2018

I was planning to, but something is still not working. It's not populating the directory properly. Logs look ok.

All three profile entries you see https://dir.hubup.pro/ are added manually via console.

This is the only error I can see.

bin/console dbupdate Updating database schema to latest version... [Error] Database was not fully updated. Use --force for migrate

Could this be a permission issue? I'm running this under a dedicated user that is part of the www-data group. Cron job also runs under this user.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 13, 2018

I did a clean installation today with the latest master because of the above db error.

Searching tags is now working but profile_poll_queue is the only table that is empty in the db.

(Signing off now. Catch you later. Cheers.)

@MrPetovan
Copy link
Collaborator

MrPetovan commented Nov 13, 2018

Can you please add

"logger": {
    "level": 100
}

at the same level as "database" in your config/local.json?

@MrPetovan
Copy link
Collaborator

Did you add a remote directory to your poll queue like bin/console directory-add https://dir.friendica.social? If you didn't, then you won't get much data.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 14, 2018

Yep. I've added two remote directories. This one and Adam's.

I'll add the logger level this evening and report back. Lets just wait with this PR until everything works properly and then I update the rewrite rules.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 14, 2018

Interestingly the server list of the directory is filling up as expected; it's only the profiles that don't seem to work.

@MrPetovan
Copy link
Collaborator

Found the issue, a wrong boolean condition: https://github.com/friendica/friendica-directory/releases/tag/v2.0.6

Your directory should fill up next time the directories will be polled. You can set the next_poll column to NOW() in the directory_poll_queue table to force the issue.

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 14, 2018

Great. I'll update to 2.0.6 as soon as I have shell access. Thanks!

@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 14, 2018

Now, it works like a charm!

Could you please review the rewrite settings. Some of it might be superfluous; it works though.

@MrPetovan
Copy link
Collaborator

Thanks for your contribution!

@MrPetovan MrPetovan merged commit 4c85d86 into friendica:master Nov 14, 2018
@AndyHee
Copy link
Contributor Author

AndyHee commented Nov 14, 2018

My pleasure!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants