פורסם: 12/04/2020 - 12:40
נושא ההודעה: שרת nginx סוגר את עצמו מדי כמה שעות
|
יש לי שרת ביתי שעובד עם nginx ולאחרונה יש תופעה מוזרה: nginx סוגר את עצמו מדי כמה שעות ובכך מונע כניסה לאתר, כמובן. יכול להיות שזה קרה עקב כמה שינויים שעשיתי בקונפיגרציה של nginx, אבל לא ברור מה בדיוק גורם לזה. האמת שיש כמה קבצי קונפיג ולא יודע מה בדיוק כן צריך ומה לא - אם יש מדריך טוב שמסביר את הנושא אשמח לדעת.
ברגע שזה קורה אני מבצע בדיקת status ל nginx וזה הפלט:
קוד: | sudo systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2020-04-12 02:15:20 UTC; 6h ago
Docs: man:nginx(8)
Process: 9663 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 10301 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 10298 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 6729 (code=exited, status=0/SUCCESS)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:20 raspberrypi nginx[10301]: nginx: [emerg] still could not bind()
Apr 12 02:15:20 raspberrypi systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 12 02:15:20 raspberrypi systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 12 02:15:20 raspberrypi systemd[1]: nginx.service: Unit entered failed state.
Apr 12 02:15:20 raspberrypi systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 12 08:48:59 raspberrypi systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive. |
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 13:59
נושא ההודעה:
|
הוא רושם לך Address already in use ל80 ו 443
תנסה לבדוק עם netstat או עם ss מה תופס את הפורטים הנל.
תנסה גם לגלוש אליהם
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 14:23
נושא ההודעה:
|
ציטוט: | הוא רושם לך Address already in use ל80 ו 443
תנסה לבדוק עם netstat או עם ss מה תופס את הפורטים הנל.
תנסה גם לגלוש אליהם |
ברגע שזה קורה אני מקבל refuse מהפורטים כשאני מנסה לגלוש עם דפדפן או curl.
https://ping.eu/port-chk אומר שהפורטים סגורים. אם יקרה שוב אבדוק עם מה שאמרת.
כרגע ניסיתי למחוק הגדרות מקבילות על אותם פורטים, בשני קבצי קונפיג של nginx, ונראה אם הבעיה נפתרה.
בכלל, יש לי קצת חוסר ידע בהגדרות השרת ,ולא ברור מדוע יש כמה קבצים ולא קובץ אחד, נניח: nginx.conf שנמצא תחת /etc/nginx/ ?? קבצי הקינפוג האחרים נמצאים תחת: /etc/nginx/conf.d/. יתכן שזה נועד לתת גמישות בהגדרות אבל אותי זה מבלבל, בגלל זה רציתי קישור למדריך שמסביר באופן יותר ברור מהתיעוד הרשמי של nginx ..
תודה
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 14:31
נושא ההודעה:
|
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 14:37
נושא ההודעה:
|
יש צעד מתבקש שאותו אפשר לעשות בלי בכלל להבין איך עובד nginx:
קוד: |
journalctl -u nginx.service
|
ואז הולכים להסתכל מה כתוב בלוגים. תקבל כנראה הודעה יותר ספציפית עם שם של קובץ תצורה.
מעבר לכך: עדיף לבדוק עם ss או netstat מכיוון שתמיד יכולות להיות הגדרות פיירוול מוזרות שמצליחות לשקר לעולם החיצון שהפורט לא בשימוש.
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 15:25
נושא ההודעה:
|
בינתיים התופעה טרם קרתה שוב - אם תתרחש אז אבדוק מה שציינתם.
אבל יתכן שהבעיה קשורה להחלפת ראוטר שבוצעה לאחרונה ובחלק מההגדרות אני לא בטוח בהן נכונות.
מצורפת תמונה של הגדרות פורטים בראוטר - זאת הברירת מחדל כשעושים פורוורדינג, נפתחות הרבה שורות עם כל מיני אפשרויות, במקום רק שתי שורות עבור שני פורטים. זה בסדר, או שיוצר כפילויות וצריך למחוק את המיותרים?
https://imgur.com/3CZGzCE
ואם כבר אנחנו מדברים על הגדרות בראוטר (ואולי גם גורם לבעיות..), אז גם ב DYNAMIC DNS יש כמה אפשרויות, כפי שניתן לראות בתמונה המצורפת. בחרתי באפשרות המוארת הראשונה - האם נכון או שצריך לשנות?
https://imgur.com/RnGIjff
תודה
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 15:32
נושא ההודעה:
|
למען הדיוק אני מחובר לשירות freedns.afraid.org אז כך נראות אפשרויות ההגדרות DDNS בראוטר:
https://imgur.com/Y6KbOp4
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 16:17
נושא ההודעה:
|
מה קשור ראוטר עכשיו?
תתחבר לוקאלית למכונה ותבצע כמו שכתבתי ss או netstat
או כמו שצפריר הרחיב
curl כמובן לIP של האינטרפייס שמאזין (מה שכתוב בקובץ התצורה) ולא לדומיין
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 16:48
נושא ההודעה:
|
[quoteמה קשור ראוטר עכשיו?][/quote]
חכה, הכל נרשם..
נדגיש שכל הפלטים הבאים הם במצב שהכל עובד כרגע ואין בעיה בשרת, וכל הפקודות מורצות מתוך הרספברי שמכיל את השרת:
ציטוט: | תתחבר לוקאלית למכונה ותבצע כמו שכתבתי ss או netstat |
לא מכיר את זה. מה הכוונה - איזו פקודה לרשום בדיוק? הפקודה של צפריר:
קוד: | $ ss -lntp | grep 443
LISTEN 0 128 *:443 *:* |
הפקודה הבאה נותנת נתונים דומים לפלט הקודם שהצגתי עם ה status של nginx - הנה הקטע מהזמן שמופיעה הבעיה ועד למצב עכשיו כשהכל עובד:
קוד: | Apr 12 02:15:17 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 12 02:15:17 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 12 02:15:17 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 12 02:15:17 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:18 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 12 02:15:18 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 12 02:15:18 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:18 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 12 02:15:18 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 12 02:15:18 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 12 02:15:19 raspberrypi nginx[10301]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 12 02:15:20 raspberrypi nginx[10301]: nginx: [emerg] still could not bind()
Apr 12 02:15:20 raspberrypi systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 12 02:15:20 raspberrypi systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 12 02:15:20 raspberrypi systemd[1]: nginx.service: Unit entered failed state.
Apr 12 02:15:20 raspberrypi systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 12 08:48:59 raspberrypi systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive.
Apr 12 08:52:00 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 12 08:52:00 raspberrypi systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 12 09:23:34 raspberrypi systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 12 09:23:34 raspberrypi systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 12 09:23:34 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 12 09:23:34 raspberrypi systemd[1]: Started A high performance web server and a reverse proxy server.
|
הנה:
קוד: | $ curl 192.168.1.4
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
|
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 16:59
נושא ההודעה:
|
תשמע.
קודם כל אתה צריך לבצע דיאגנוזה שהתקלה מתרחשת.
בפשטות - סרבר אחר תופס את הפורטים.
זה אפילו יכול להיות אולי שני סרביסים בקבצי הקונפיגורציה שמאזינים לאותם פורטים ויש התנגשות.
לא מדע טילים
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 17:08
נושא ההודעה:
|
ציטוט: | קודם כל אתה צריך לבצע דיאגנוזה שהתקלה מתרחשת. |
כן, ברור.
ציטוט: | זה אפילו יכול להיות אולי שני סרביסים בקבצי הקונפיגורציה שמאזינים לאותם פורטים ויש התנגשות. |
אכן זה החשד. שיניתי משהו בקבצי תצורה ואם זה לא פתר את הבעיה אז אבצע בדיקות כפי שציינתם.
ובלי קשר: אשמח להתיחסות לשאלות שלי לגבי הגדרות בראוטר..
תודה
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 17:22
נושא ההודעה:
|
אתה יכול לנסות להריץ
כשאתה בתוך תיקית /etc/nginx
זה יכול להיות קצה חוט אם יש דופליקציה בקונפיגורציה
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 17:53
נושא ההודעה:
|
כשהתקנתי את השרת עקבתי אחר המדריך הזה שכפי שניתן לראות בשני הקישורים הבאים יש שני קבצי תצורה: default, drupal. לא יודע אם זה תקין אבל רואים את הכפילות בפקודה שציינת:
https://www.linuxbabe.com/linux-server/drupal-8-ubuntu-16-04-nginx-mariadb-php7
https://www.linuxbabe.com/linux-server/install-nginx-mariadb-php7-lemp-stack-ubuntu-16-04-lts
קוד: | $ sudo grep -R 443
sites-available/default: # listen 443 ssl default_server;
sites-available/default: # listen [::]:443 ssl default_server;
conf.d/default.bak: listen 443 ssl;
conf.d/default.bak:# listen 8443 ssl;
conf.d/default.bak:# listen [::]:443 ssl;
conf.d/default.bak:# listen 443 ssl;
conf.d/drupal.conf: listen 443 ssl; # managed by Certbot
conf.d/drupal.bak2: listen 443 ssl; # managed by Certbot
conf.d/drupal.bak: listen 443 ssl; # managed by Certbot
conf.d/default.conf: listen 443 ssl;
conf.d/default.conf:# listen 8443 ssl;
conf.d/default.conf:# listen [::]:443 ssl;
conf.d/default.conf:# listen 443 ssl;
|
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 18:35
נושא ההודעה:
|
נו? ו?
אני בטוח שאתה יודע להמשיך מכאן לבד, לא? (לא לשכוח גם את 80)
לא נכנסתי לקישורים שהבאת.
|
|
חזרה לתוכן הדיון |
פורסם: 12/04/2020 - 20:36
נושא ההודעה:
|
לא ברור למה הכפילות הזו מופיעה במדריך, או שלא הבנתי את כוונת המשורר שם..
כרגע עדיין הכל עובד, לאחר שבטלתי כמה כפילויות בתצורה בבוקר, ואני אמתין עוד יום לראות מה קורה. בכל מקרה נראה שאצטרך לבטל את כפל ההגדרות (גם של פורט 80 כמובן) שהופיעו בפלט האחרון..
צרפתי את הפלט לגבי פורט 80 ואני רואה הגדרה פעילה (ללא #) מהסוג ;listen [::]:80 שלא מופיעה בפורט 443 - האם צריך להוסף שורה: ;listen [::]:443 ssl - מה ההבדל בין זה לבין: ;listen 443 ssl?
תודה
קוד: | /etc/nginx $ sudo grep -R 80
sites-available/default: listen 80 default_server;
sites-available/default: listen [::]:80 default_server;
sites-available/default:# listen 80;
sites-available/default:# listen [::]:80;
conf.d/default.bak: listen 80;
conf.d/default.bak: listen [::]:80;
conf.d/default.bak: listen 127.0.0.1:80;
conf.d/drupal.conf: listen 80;
conf.d/drupal.bak2: listen 80;
conf.d/drupal.bak: listen 80;
conf.d/sub_status.conf:listen 127.0.0.1:80;
conf.d/default.conf:# listen 127.0.0.1:80;
conf.d/default.conf: listen 80;
conf.d/default.conf: listen [::]:80;
|
|
|
חזרה לתוכן הדיון |
פורסם: 13/04/2020 - 14:02
נושא ההודעה:
|
Anonymous : | לא ברור למה הכפילות הזו מופיעה במדריך, או שלא הבנתי את כוונת המשורר שם..
כרגע עדיין הכל עובד, לאחר שבטלתי כמה כפילויות בתצורה בבוקר, ואני אמתין עוד יום לראות מה קורה. בכל מקרה נראה שאצטרך לבטל את כפל ההגדרות (גם של פורט 80 כמובן) שהופיעו בפלט האחרון..
צרפתי את הפלט לגבי פורט 80 ואני רואה הגדרה פעילה (ללא #) מהסוג ;listen [::]:80 שלא מופיעה בפורט 443 - האם צריך להוסף שורה: ;listen [::]:443 ssl - מה ההבדל בין זה לבין: ;listen 443 ssl?
תודה
קוד: | /etc/nginx $ sudo grep -R 80
sites-available/default: listen 80 default_server;
sites-available/default: listen [::]:80 default_server;
sites-available/default:# listen 80;
sites-available/default:# listen [::]:80;
conf.d/default.bak: listen 80;
conf.d/default.bak: listen [::]:80;
conf.d/default.bak: listen 127.0.0.1:80;
conf.d/drupal.conf: listen 80;
conf.d/drupal.bak2: listen 80;
conf.d/drupal.bak: listen 80;
conf.d/sub_status.conf:listen 127.0.0.1:80;
conf.d/default.conf:# listen 127.0.0.1:80;
conf.d/default.conf: listen 80;
conf.d/default.conf: listen [::]:80;
|
|
סליחה. לא שמתי לב לשאלה שלך
הסימן [::] אומר להאזין בכל האינטרפייסים במכונה שתומכים ב IPV6
|
|
חזרה לתוכן הדיון |
פורסם: 13/04/2020 - 14:15
נושא ההודעה: מניח שלראוטר לא תקבל כאן תשובה, או שתקבל תשובה כללית
|
Anonymous : |
ובלי קשר: אשמח להתיחסות לשאלות שלי לגבי הגדרות בראוטר..
תודהAnonymous : |
ואם כבר אנחנו מדברים על הגדרות בראוטר (ואולי גם גורם לבעיות..), אז גם ב DYNAMIC DNS יש כמה אפשרויות, כפי שניתן לראות בתמונה המצורפת. בחרתי באפשרות המוארת הראשונה - האם נכון או שצריך לשנות?
https://imgur.com/RnGIjff
תודה |
|
לא יודע.
נראה לי שזה קשור למאפיני החיבור. שאולי קשורים לכך שמדובר, לפי הערכה שלי, בתשתית בזק. וגם לנתב המסוים. מעריך שלא תקבל כאן תשובה לשאלה. או שתקבל רק תשובה כללית. האם ניסית לחפש בגוגל? לשאול את תמיכת בזק, או תמיכת ספק האינטרנט? נא פרסם כאן מידע נוסף, אם יהיה. תודה.
|
|
חזרה לתוכן הדיון |
פורסם: 13/04/2020 - 14:33
נושא ההודעה:
|
ציטוט: | סליחה. לא שמתי לב לשאלה שלך
הסימן [::] אומר להאזין בכל האינטרפייסים במכונה שתומכים ב IPV6 |
תודה על ההסבר!
בינתים שוב התעוררה בעיה והחלטתי לבטל את כל הכפילויות כפי שדובר בפוסט קודם.
ואז שוב השרת נתקע, וכנראה שגם הסימן [::] עושה בעיות, ולכן בטלתי את השורות האלו - כרגע יש בקבצי תצורה האזנה רק ל:
קוד: | listen 80;
listen 443 ssl; |
מקווה שזה פתר את הבעיה - נעדכן בהמשך..
דרך אגב: כשאני פונה עם curl לכתובת https כלומר לפורט 443, אני מקבל הרבה שורות קוד מתוך דף הבית - דומה למה שמקבלים כשפונים לכתובת של הפורום הזה curl https://whatsup.org.il -
וזה כנראה בסדר. אבל כשאני פונה לכתובת הלא מאובטחת http דרך פורט 80 אני מקבל את הפלט הבא - זה תקין או טעון שיפור?
קוד: | <html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
|
וכשאני פונה מתוך השרת לכתובת שלו עצמו אני מקבל:
קוד: | $ curl 192.168.1.4
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
|
|
|
חזרה לתוכן הדיון |
פורסם: 13/04/2020 - 14:57
נושא ההודעה:
|
הסימן [::] הוא הכתובת הכללית של IPv6.
זה לגיטימי שיהיו לך כמה אתרים שונים ב־available. לדוגמה:
אם רק אחד מהם מקושר מ־enabled.
או אם הם משמשים לשמות אתרים שונים (virtual hosting).
התשובה 301 היא מה שה־certbot שם שם: כל מי שמתחבר לחיבור הלא מאובטח (80) מופנה לחיבור המאובטח (443 עם HTTPS). האם אתה רוצה גם אפשרות להתחבר בפורט 80 ללא הצפנה?
|
|
חזרה לתוכן הדיון |
פורסם: 13/04/2020 - 14:57
נושא ההודעה:
|
ציטוט: | נראה לי שזה קשור למאפיני החיבור. שאולי קשורים לכך שמדובר, לפי הערכה שלי, בתשתית בזק. וגם לנתב המסוים. מעריך שלא תקבל כאן תשובה לשאלה. או שתקבל רק תשובה כללית. האם ניסית לחפש בגוגל? לשאול את תמיכת בזק, או תמיכת ספק האינטרנט? נא פרסם כאן מידע נוסף, אם יהיה. תודה. |
לא יודע כמה אפשר לסמוך על כך, אבל לפי מה שאמרו לי בתמיכה של פרטנר עבור DDNS צריך לבחור באפשרות האחרונה: pppoe_eth4/eth4.2.
חפשתי בגוגל אבל לא כל כך הבנתי בדיוק.. אכן, התשתית היא של בזק. מקווה שבכל זאת מישהו יכול להאיר את עינינו..
תודה
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 13:18
נושא ההודעה:
|
לאחר סדרת שינוים בקובץ תצורה שלא עזרו בפתרון הבעיה, נראה שכרגע השרת עבד רצוף למעלה משתי יממות, ויש לי כאן כמה עדכונים ושאלות ברשותכם:
האזנה כפולה לאותו פורט: בטלתי כפילויות, אבל לא הכי מבין מדוע זה תוקע את השרת. אם יש בעיה כזו אז מדוע שלא יתבצע אתחול לשרת, במקום לסגור אותו? כשאני מאתחל את nginx.service אז הוא חוזר לעבוד.. אם אפשר הסבר.
בנוסף לכך, ראיתי את הקישור הבא, שעוסק בשגיאה דומה לשגיאה שלי שמופיעה בפלט לעיל, ויש שם הצעות לפתרון: ראשית לגבי IPv6 הם הציעו לרשום כך: listen [::]:80 ipv6only=on .
וגם כנראה שנדרש לבצע kill ורק לאחר מכן לאתחל את השרת: fuser -k 80/tcp, fuser -k 443/tcp
נראה שהשינוים הנל פתרו את הבעיה.
https://stackoverflow.com/questions/14972792/nginx-nginx-emerg-bind-to-80-failed-98-address-already-in-use
מקווה שהבעיה נפתרה ואשמח להסבר שיבהיר קצת יותר את המצב..
תודה
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 14:27
נושא ההודעה:
|
עוד לא סיימתי לכתוב את הפוסט הקודם וחשבתי שהשרת בסדר והנה שוב נתקע..
לא יודע מה עוד ניתן לעשות?? זה הפלט של journalctl -u nginx.service:
קוד: | Apr 16 10:14:31 raspberrypi systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 16 10:14:31 raspberrypi systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 16 10:14:43 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 16 10:14:43 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 10:14:43 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 10:14:43 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 10:14:43 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 10:14:44 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 10:14:45 raspberrypi nginx[30257]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 10:14:46 raspberrypi nginx[30257]: nginx: [emerg] still could not bind()
Apr 16 10:14:46 raspberrypi systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 16 10:14:46 raspberrypi systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 16 10:14:46 raspberrypi systemd[1]: nginx.service: Unit entered failed state.
Apr 16 10:14:46 raspberrypi systemd[1]: nginx.service: Failed with result 'exit-code'.
|
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 15:27
נושא ההודעה: למה הוא עצר? למה הוא התחיל מחדש?
|
Anonymous : | עוד לא סיימתי לכתוב את הפוסט הקודם וחשבתי שהשרת בסדר והנה שוב נתקע..
לא יודע מה עוד ניתן לעשות?? זה הפלט של journalctl -u nginx.service:
קוד: | Apr 16 10:14:31 raspberrypi systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 16 10:14:31 raspberrypi systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 16 10:14:43 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
|
|
למה הוא עצר? למה הוא התחיל מחדש?
רק מנחש. יתכן שלא בכיוון בכלל, ומבזבז זמן שלי ושל אחרים. מסב את תשומת לב הקורא שכנראה נכשל רק אחרי שהתחיל מחדש. וזה קרה רק אחרי שעצר. או כך נראה לי. יתכן שסדר הפעולות שרשמתי שגוי.
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 15:44
נושא ההודעה:
|
ציטוט: | למה הוא עצר? למה הוא התחיל מחדש? |
אכן, ראיתי את זה ולכן צרפתי לפלט. אבל לא מבין איזו סוג בעיה אמורה לעצור אותו.
ולגבי הכשלון באתחול מחדש: יתכן שצריך לבצע kill לפני כן, כפי שמופיע בקישור שצרפתי בפוסט קודם.
בקיצור, לא יודע מה קורה.. הפלט יכול ללמד עוד משהו?
תודה
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 17:47
נושא ההודעה:
|
אני מניח שמי שמפעיל אותו מחדש הוא systemd:
קוד: |
systemctl cat nginx.service | grep Restart
|
(או לחילופין: show במקום cat).
ציטוט: |
האזנה כפולה לאותו פורט: בטלתי כפילויות, אבל לא הכי מבין מדוע זה תוקע את השרת. אם יש בעיה כזו אז מדוע שלא יתבצע אתחול לשרת, במקום לסגור אותו? כשאני מאתחל את nginx.service אז הוא חוזר לעבוד.. אם אפשר הסבר.
|
התוכנית גילתה בעיה. היא יכולה לנסות לטפל בה, או להעביר את הטיפול בבעיה הלאה. אם אין טיפול טוב, עדיף אולי להכשל ולא לעבוד מאשר להראות כאילו זה עובד. יש כאן בעי: השרת לא מצליח להקשיב על חלק מהפורטים. הכותבים שלו העדיפו להתייחס לבעיה כבעיה חמורה ולהעביר אותה לטיפול המשתמש.
הרגת תהליכים אחרים שהקשיבו על הפורט. אבל מי הם היו? היית אמור לקבל אותם כפלט של
ss -lntp
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 18:00
נושא ההודעה:
|
לא יודע אם התכוונת להריץ את הפקודה כשהוא תקוע או לא - כרגע הפעלתי את השרת בעצמי מחדש - אין פלט ל cat וזה הפלט ל show:
קוד: | $ systemctl show nginx.service | grep Restart
Restart=no
RestartUSec=100ms
|
כרגע זה מה שיש - השורה הראשונה ב 80 נראית לא רלוונטית לעניין שלנו..לי לא נראה שיש כפילות:
קוד: | $ ss -lntp | grep 80
LISTEN 0 80 127.0.0.1:3306 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 :::80 :::* |
קוד: | $ ss -lntp | grep 443
LISTEN 0 128 *:443 *:*
LISTEN 0 128 :::443 |
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 18:05
נושא ההודעה:
|
יותר מדויק..
קוד: | $ ss -lntp | grep 443
LISTEN 0 128 *:443 *:*
LISTEN 0 128 :::443 :::* |
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 19:22
נושא ההודעה:
|
תריץ בבקשה עם SUDO כדי לראות את מספר ושם התהליך לכל פורט.
ותעשה את זה רק מתי כשיש בעיה - רק אז הפלט יהיה רלוונטי.
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 21:31
נושא ההודעה:
|
זה קרה מהר הפעם.. עכשיו השרת תקוע והנה הפלטים:
כאן נראה שלא קשור לפורט 80 אבל לבחינתכם:
קוד: | sudo ss -lntp | grep 80
LISTEN 0 80 127.0.0.1:3306 *:* users:(("mysqld",pid=590,fd=135))
|
443 לא נותן כלום.. sudo ss -lntp | grep 443
זה פלט של sudo journalctl -u nginx.service:
קוד: | Apr 16 13:48:42 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 16 13:48:42 raspberrypi systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 16 18:17:55 raspberrypi systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 16 18:17:55 raspberrypi systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 16 18:18:08 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 18:18:08 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 18:18:09 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 18:18:10 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Apr 16 18:18:10 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Apr 16 18:18:10 raspberrypi nginx[31775]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 16 18:18:10 raspberrypi nginx[31775]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 16 18:18:10 raspberrypi nginx[31775]: nginx: [emerg] still could not bind()
Apr 16 18:18:10 raspberrypi systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 16 18:18:10 raspberrypi systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 16 18:18:10 raspberrypi systemd[1]: nginx.service: Unit entered failed state.
Apr 16 18:18:10 raspberrypi systemd[1]: nginx.service: Failed with result 'exit-code'.
|
|
|
חזרה לתוכן הדיון |
פורסם: 16/04/2020 - 22:05
נושא ההודעה:
|
תן פלט של SS ללא ה GREP...
|
|
חזרה לתוכן הדיון |
|