Link to home
Start Free TrialLog in
Avatar of Scott Walker
Scott WalkerFlag for United States of America

asked on

Having trouble enabling SEO-friendly Permalinks in WordPress

Hello, Experts! We are trying to enable SEO-friendly Permalinks in a new WordPress installation (we moved a 500+ post Blog from WordPress.com to our own hosting environment). Happy to provide other details upon request.

[NOTE: I AM FAR FROM KNOWLEDGEABLE IN THIS AREA, AND I ATTEMPTED TO REDACT SECURE INFORMATION, BUT IF I SHOULD REMOVE SOMETHING ELSE, I'D APPRECIATE YOUR LETTING ME KNOW!]  :-)

We copy-pasted the following code into the nginx config file:
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}

Removed the above and copy-pasted the following code into the nginx config file:
location /blog/ {
try_files $uri $uri/ @wordpress;
}

location @wordpress {
rewrite /blog/ /blog/index.php;
}

location ^/blog/index.php(/.)?$ {
fastcgi_split_path_info ^(/blog/index.php)(/.)$;
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_param;
}

Both times, running "sudo systemctl reload nginx" to enable the changes returned an error. Below are the error messages and logs.

our-domain@web01:/etc/nginx$ sudo systemctl reload nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
our-domain@web01:/etc/nginx$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) (Result: exit-code) since Wed 2020-11-11 13:29:34 EST; 2 months 13 days ago
Process: 4470 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=1/FAILURE)
Process: 991 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 904 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 1000 (nginx)
CGroup: /system.slice/nginx.service
├─ 1000 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─15399 nginx: worker process
├─15400 nginx: worker process
├─15401 nginx: worker process
├─15402 nginx: worker process
├─15403 nginx: worker process
├─15404 nginx: worker process
├─15405 nginx: worker process
└─15406 nginx: worker process
our-domain@web01:/etc/nginx$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
our-domain@web01:/etc/nginx$ sudo journalctl -xe
Jan 24 17:33:41 web01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=**:**:**:**:**:**:**:**:**:**:**:**:**:** SRC=92.63.197.88 DST=45.79.182.19 LEN=40 TOS=0x00 PREC=0x00 TTL=
Jan 24 17:33:43 web01 sshd[4759]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=201.48.34.199 user=root
Jan 24 17:33:43 web01 sshd[4688]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=134.209.126.170 user=root
Jan 24 17:33:45 web01 sshd[4759]: Failed password for root from 201.48.34.199 port 39838 ssh2
Jan 24 17:33:45 web01 sshd[4759]: Received disconnect from 201.48.34.199 port 39838:11: Bye Bye [preauth]
Jan 24 17:33:45 web01 sshd[4759]: Disconnected from 201.48.34.199 port 39838 [preauth]
Jan 24 17:33:45 web01 sshd[4688]: Failed password for root from 134.209.126.170 port 56156 ssh2
Jan 24 17:33:45 web01 sshd[4688]: Received disconnect from 134.209.126.170 port 56156:11: Bye Bye [preauth]
Jan 24 17:33:45 web01 sshd[4688]: Disconnected from 134.209.126.170 port 56156 [preauth]
Jan 24 17:33:46 web01 sshd[4376]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=101.32.206.243 user=root
Jan 24 17:33:47 web01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=f2:3c:91:b3:25:39:84:78:ac:57:a8:41:08:00 SRC=185.236.11.2 DST=45.79.182.19 LEN=40 TOS=0x00 PREC=0x00 TTL=
Jan 24 17:33:48 web01 sshd[4376]: Failed password for root from 101.32.206.243 port 58978 ssh2
Jan 24 17:33:48 web01 sshd[4376]: Received disconnect from 101.32.206.243 port 58978:11: Bye Bye [preauth]
Jan 24 17:33:48 web01 sshd[4376]: Disconnected from 101.32.206.243 port 58978 [preauth]
Jan 24 17:33:58 web01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=**:**:**:**:**:**:**:**:**:**:**:**:**:** SRC=**.**.**.** DST=45.79.182.19 LEN=40 TOS=0x00 PREC=0x00 TTL=
Jan 24 17:34:01 web01 sshd[5901]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=1.85.13.236 user=root
Jan 24 17:34:01 web01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=**:**:**:**:**:**:**:**:**:**:**:**:**:** SRC=194.62.6.216 DST=172.104.12.150 LEN=62 TOS=0x08 PREC=0x20 TT
Jan 24 17:34:02 web01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=**:**:**:**:**:**:**:**:**:**:**:**:**:** SRC=194.147.140.109 DST=172.104.12.150 LEN=40 TOS=0x00 PREC=0x00
Jan 24 17:34:03 web01 sshd[5901]: Failed password for root from 1.85.13.236 port 56210 ssh2
Jan 24 17:34:03 web01 sshd[5901]: Received disconnect from 1.85.13.236 port 56210:11: Bye Bye [preauth]
Jan 24 17:34:03 web01 sshd[5901]: Disconnected from 1.85.13.236 port 56210 [preauth]
Jan 24 17:34:04 web01 sshd[6048]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=35.244.25.124 user=root
Jan 24 17:34:06 web01 sshd[6048]: Failed password for root from 35.244.25.124 port 33292 ssh2
Jan 24 17:34:06 web01 sshd[6048]: Received disconnect from 35.244.25.124 port 33292:11: Bye Bye [preauth]
Jan 24 17:34:06 web01 sshd[6048]: Disconnected from 35.244.25.124 port 33292 [preauth]
Jan 24 17:34:12 web01 sshd[6517]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.192.233.228 user=root
Jan 24 17:34:15 web01 sshd[6517]: Failed password for root from 42.192.233.228 port 60028 ssh2
Jan 24 17:34:15 web01 sshd[6517]: Received disconnect from 42.192.233.228 port 60028:11: Bye Bye [preauth]
Jan 24 17:34:15 web01 sshd[6517]: Disconnected from 42.192.233.228 port 60028 [preauth]
Jan 24 17:34:18 web01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=f2:3c:91:b3:25:39:84:78:ac:57:a8:41:08:00 SRC=45.146.165.25 DST=172.104.12.150 LEN=40 TOS=0x00 PREC=0x00 T
Jan 24 17:34:21 web01 sshd[6972]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=119.29.237.201 user=root
Jan 24 17:34:23 web01 sshd[6972]: Failed password for root from 119.29.237.201 port 56128 ssh2
Jan 24 17:34:23 web01 sshd[6972]: Received disconnect from 119.29.237.201 port 56128:11: Bye Bye [preauth]
Jan 24 17:34:23 web01 sshd[6972]: Disconnected from 119.29.237.201 port 56128 [preauth]
Jan 24 17:34:25 web01 sshd[7355]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.81.215.123 user=root
Jan 24 17:34:27 web01 sshd[7355]: Failed password for root from 192.81.215.123 port 60102 ssh2
Jan 24 17:34:27 web01 sshd[7355]: Received disconnect from 192.81.215.123 port 60102:11: Bye Bye [preauth]
Jan 24 17:34:27 web01 sshd[7355]: Disconnected from 192.81.215.123 port 60102 [preauth]
Jan 24 17:34:30 web01 sshd[7690]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=190.145.254.138 user=root
Jan 24 17:34:32 web01 sshd[7690]: Failed password for root from 190.145.254.138 port 8243 ssh2
Jan 24 17:34:32 web01 sshd[7690]: Received disconnect from 190.145.254.138 port 8243:11: Bye Bye [preauth]
Jan 24 17:34:32 web01 sshd[7690]: Disconnected from 190.145.254.138 port 8243 [preauth]
Jan 24 17:34:43 web01 sshd[8439]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=14.63.162.98 user=root
Jan 24 17:34:45 web01 sshd[8439]: Failed password for root from 14.63.162.98 port 42869 ssh2
Jan 24 17:34:45 web01 sshd[8439]: Received disconnect from 14.63.162.98 port 42869:11: Bye Bye [preauth]
Jan 24 17:34:45 web01 sshd[8439]: Disconnected from 14.63.162.98 port 42869 [preauth]
Jan 24 17:34:54 web01 sshd[9172]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=114.233.159.83 user=root
Jan 24 17:34:54 web01 sudo[9357]: our-domain : TTY=pts/0 ; PWD=/etc/nginx ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 24 17:34:54 web01 sudo[9357]: pam_unix(sudo:session): session opened for user root by our-domain(uid=0)


Avatar of David Favor
David Favor
Flag of United States of America image

Problem appears to be "No journal files were opened due to insufficient permissions" which suggests you're trying to issue root level commands using a non-root user.

This simply won't work.

You must be running as root for issued systemd commands to work.

This seems odd as it appears likely you're logged in as root.
Could also be you're out of disk space.

Run this command + provide resulting output here...

journalctl --vacuum-size=10M

Open in new window


This command should throw away any large journals, which might be sufficient to fix this problem.

Fairly likely you're going to require a Command Line Savant to shell into your machine/container/VM to debug this by looking at entire /var/log file content... all logs considered together...
Avatar of Scott Walker

ASKER

Thank you so much - trying that now! :-)
Thanks for the expert advice! In response:

I tried running reloading nginx as the root user, and the error still happened:
root@web01:/etc/nginx# systemctl reload nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

I ran the suggested journal cleanup command; output is below. It did not fix the error:
our-domain@web01:/etc/nginx$ sudo journalctl --vacuum-size=10M
[sudo] password for our-domain:
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000002db856-0005b7c0f33d8bfb.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000002f1c52-0005b7dbad8c20c4.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-0000000000308094-0005b7f379d9505e.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000031ddd1-0005b811eeba3ce5.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003343ad-0005b82f4316e9be.journal (72.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-0000000000348e98-0005b850ed8e513d.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000035e188-0005b86cfe4fa03f.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003736a1-0005b88e06b9fa0f.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000038a072-0005b8a999326159.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003a0435-0005b8c9f2cbd1fa.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003b6859-0005b8e8837914df.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003cc8c9-0005b906afb969d5.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003e2b14-0005b928211407b3.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-00000000003f91d6-0005b947da4a599b.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000040f435-0005b96b73d3fb30.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-0000000000425521-0005b993166c8604.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000043a72e-0005b9b9fa777822.journal (72.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000044f210-0005b9e149589e02.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-000000000046466b-0005ba0b04e67a84.journal (80.0M).
Deleted archived journal /run/log/journal/beb217fbb4324b7d9959f78c279e6599/system@d0ec3a52aae04ea0887f22b3ba63baf8-0000000000479e60-0005ba370aad1505.journal (80.0M).
Vacuuming done, freed 1.5G of archived journals on disk.



Is there any chance that the fact that we've installed WordPress in the /blog subdirectory is causing the problem? Is anything above pointing to root level, when it should be pointing to /blog? Thanks again! :-)  

The message "No journal files were opened due to insufficient permissions" suggests some non-root user (user nginx... maybe...) is attempting to run root level operations.

Trivial to debug being shelled in the machine.

Near impossible to guess, by just looking at logs.

Try this action sequence...

sudo bash

service nginx reload

Open in new window


If this action sequence works, then likely something's in /etc/sudousers requires attention.
Thanks so much - trying that now...
Be interesting to see if this sequence works.
We tried these commands and got the same error:
our-domain@web01:~/our-domain.org$ sudo bash
root@web01:~/our-domain.org# service nginx reload
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
As the above mentions, run this command...

journalctl -xe > debug.log

Open in new window


Then attach (as text) your debug.log file for analysis.

Take a look this file yourself. You might determine a fix by the log contents.
David - thank you! Sorry that I didn't see that command mentioned previously, but we're trying it now. :-)  

David - we have the output - is there a way to send it to you directly, rather than giving everyone on experts-exchange access to it? Thanks again!
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial