昨天晚上想要查看放在高雄家鋼琴上的 Pi 3 裡面是否有安裝 Apache 伺服器, 用瀏覽器連線它的固定網址 192.168.2.193 卻無法連線, 印象中似乎有安裝過 Apache + WordPress 啊! 要怎麼檢查是否安裝過 Apache 呢? 我找到下面這篇文章 :
首先可用 netsta -tlup 指令檢查網路連線 :
pi@raspberrypi:~ $ netstat -tlnp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 :::5900 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
有 127.0.0.1 應該就是有安裝. 但具體是甚麼伺服器則可要檢查啟用的 service :
pi@raspberrypi:~ $ sudo service --status-all
[ - ] alsa-utils
[ - ] apache-htcacheclean
[ - ] apache2
[ - ] apparmor
[ + ] avahi-daemon
[ - ] bluetooth
[ - ] console-setup.sh
[ + ] cron
[ + ] cups
[ - ] cups-browsed
[ + ] dbus
[ + ] dhcpcd
[ + ] dphys-swapfile
[ + ] fake-hwclock
[ - ] fio
[ - ] hwclock.sh
[ - ] keyboard-setup.sh
[ + ] kmod
[ + ] lightdm
[ - ] mysql
[ - ] networking
[ - ] nfs-common
[ - ] paxctld
[ - ] plymouth
[ - ] plymouth-log
[ + ] procps
[ + ] raspi-config
[ ? ] rng-tools
[ - ] rpcbind
[ - ] rsync
[ + ] rsyslog
[ - ] saned
[ + ] ssh
[ - ] sudo
[ + ] triggerhappy
[ + ] udev
[ - ] x11-common
果然有 Apache2, 接著檢視 Apache2 的目錄 :
pi@raspberrypi:~ $ sudo ls -ls /etc/apache2
總計 80
8 -rw-r--r-- 1 root root 7260 5月 20 2021 apache2.conf
4 drwxr-xr-x 2 root root 4096 5月 20 2021 conf-available
4 drwxr-xr-x 2 root root 4096 5月 20 2021 conf-enabled
4 -rw-r--r-- 1 root root 1782 8月 8 2020 envvars
32 -rw-r--r-- 1 root root 31063 8月 8 2020 magic
12 drwxr-xr-x 2 root root 12288 5月 20 2021 mods-available
4 drwxr-xr-x 2 root root 4096 5月 20 2021 mods-enabled
4 -rw-r--r-- 1 root root 320 8月 8 2020 ports.conf
4 drwxr-xr-x 2 root root 4096 5月 20 2021 sites-available
4 drwxr-xr-x 2 root root 4096 5月 20 2021 sites-enabled
沒錯啦, 這就確定已經有安裝 Apache2 了. 下一步是安裝 WordPress.
沒有留言 :
張貼留言