树莓派nginx无法安装mysql_树莓派上安装nginx
概述
其實也就是正常的debian系統安裝穩定版的nginx
參考鏈接
步驟
新建文件夾nginx,隨便名字都可以
執行lsb_release -a查看Debian版本號:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
可知,版本號是9.4,代號是stretch
編輯 /etc/apt/sources.list 添加如下代碼
deb http://nginx.org/packages/debian/ codename nginx
deb-src http://nginx.org/packages/debian/ codename nginx
替換 codename 為 stretch
執行 apt-get update 等待update完成
執行 apt-get install nginx安裝nginx
遇到的問題
apt-get install nginx之后發現出錯,信息如下:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en abled)
Active: failed (Result: exit-code) since Sat 2018-07-07 07:32:02 UTC; 64ms ag o
Docs: man:nginx(8)
Process: 4566 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code =exited, status=1/FAILURE)
Process: 4563 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
提醒nginx.service工作失敗,請運行 systemctl status nginx.service和journalctl -xe查看詳情。以下是 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: failed (Result: exit-code) since Sat 2018-07-07 07:32:02 UTC; 3min 37s ago
Docs: man:nginx(8)
Process: 4566 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 4563 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Jul 07 07:32:00 dukeworks nginx[4566]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jul 07 07:32:01 dukeworks nginx[4566]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 07 07:32:01 dukeworks nginx[4566]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jul 07 07:32:01 dukeworks nginx[4566]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jul 07 07:32:01 dukeworks nginx[4566]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jul 07 07:32:02 dukeworks nginx[4566]: nginx: [emerg] still could not bind()
Jul 07 07:32:02 dukeworks systemd[1]: nginx.service: Control process exited, code=exited status=1
Jul 07 07:32:02 dukeworks systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jul 07 07:32:02 dukeworks systemd[1]: nginx.service: Unit entered failed state.
Jul 07 07:32:02 dukeworks systemd[1]: nginx.service: Failed with result 'exit-code'.
可以看到就是端口被占用的導致啟動失敗。
經檢查,發現80端口被apache2占用了,這個是之前裝Aria2的時候安裝的。
所以這個是正常的,暫時不予解決,等真正要用到nginx的時候再改。
總結
以上是生活随笔為你收集整理的树莓派nginx无法安装mysql_树莓派上安装nginx的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql 安装 菜鸟_mysql安装
- 下一篇: jTable保存到mysql_怎么把从数