Apache 웹 서버가 실행 중이지만 httpd는 실행되지 않습니다.

Apache 웹 서버가 실행 중이지만 httpd는 실행되지 않습니다.

이상한 문제에 직면했습니다. 서버에 연결된 도메인을 통해 서버의 네트워크 접근 가능한 디렉터리에 접근할 때. 그것은 말한다 :-

Not Found
The requested URL / was not found on this server.

내 서버에서(putty를 통해) 이 명령을 실행하면 Apache 웹 서버가 실행 중임을 나타내는 여러 프로세스 ID가 표시됩니다(정확함).

root@...:~# pgrep apache
4733
13505
13506
13507
13508
13686
14199
17672

하지만 이 명령을 실행하면 httpd: 인식할 수 없는 서비스라고 표시됩니다.

root@...:~# service httpd status
httpd: unrecognized service

다른 명령 출력:-

root@...:~# ps aux|grep -i http
root     29401  0.0  0.0   6460   792 pts/0    S+   02:21   0:00 grep --color=auto -i http

root@...:~# chkconfig --list | grep httpd
-bash: chkconfig: command not found

root@...:~# find / -name httpd*
/var/www/vhosts/lvps5-35-241-230.dedicated.hosteurope.de/httpdocs
/var/www/vhosts/.skel/0/httpdocs
/opt/psa/var/httpd_restart
/usr/lib/apache2/modules/httpd.exp
/usr/share/doc/apache2-doc/manual/fr/programs/httpd.html
/usr/share/doc/apache2-doc/manual/pt-br/programs/httpd.html
/usr/share/doc/apache2-doc/manual/da/programs/httpd.html
/usr/share/doc/apache2-doc/manual/zh-cn/programs/httpd.html
/usr/share/doc/apache2-doc/manual/tr/programs/httpd.html
/usr/share/doc/apache2-doc/manual/en/programs/httpd.html
/usr/share/doc/apache2-doc/manual/ja/programs/httpd.html
/usr/share/doc/apache2-doc/manual/ko/programs/httpd.html
/usr/share/doc/apache2-doc/manual/de/programs/httpd.html
/usr/share/doc/apache2-doc/manual/es/programs/httpd.html
/usr/share/doc/apache2-doc/examples/apache2/original/httpd.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-autoindex.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-manual.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-userdir.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-vhosts.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-languages.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-mpm.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-default.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-dav.conf
/usr/share/doc/apache2-doc/examples/apache2/original/extra/httpd-info.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-autoindex.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-manual.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-userdir.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-vhosts.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-languages.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-mpm.conf.gz
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-default.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-dav.conf
/usr/share/doc/apache2-doc/examples/apache2/extra/httpd-info.conf
/etc/apache2/httpd.conf
/etc/apache2/httpd.pem

root@...:~# whereis httpd
httpd:

root@...:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:        12.04
Codename:       precise

root@...:~# ls /etc/init.d
README             hostname           network-interface-container  plymouth-upstart-bridge  rc              spamassassin            udevtrigger
apache2            hwclock            network-interface-security   portmap                  rc.local        ssh                     umountfs
bind9              hwclock-save       networking                   portmap-wait             rcS             stop-bootlogd           umountnfs.sh
bluetooth          keymap.sh          ondemand                     postfix                  reboot          stop-bootlogd-single    umountroot
bootlogd           killprocs          passwd                       procps                   rpcbind-boot    sudo                    unattended-upgrades
console-screen.sh  klogd              pc-remote                    psa                      rsync           sw-cp-server            urandom
courier-imap       module-init-tools  plymouth                     psa-firewall             saslauthd       sysklogd                wide-dhcpv6-client
cron               modules_dep.sh     plymouth-log                 psa-firewall-forward     screen-cleanup  udev                    x11-common
dbus               mongodb            plymouth-ready               psa-spamassassin         sendsigs        udev-fallback-graphics  xinetd
fetchmail          mysql              plymouth-splash              quota                    single          udev-finish
halt               network-interface  plymouth-stop                quotarpc                 skeleton        udevmonitor

root@...:~# ls /etc/xinetd.d
chargen  daytime  discard  echo  ftp_psa  poppassd_psa  time

답변1

"lsof" 명령을 사용하고 "http"를 찾으면 Apache 웹 사이트 프로세스가 실제로 Ubuntu에서 실행되고 있는지 쉽게 확인할 수 있습니다. 나는:

 sudo lsof | grep ':http '

알겠어요

 apache2    2202                 root    4u     IPv6              15516      0t0        TCP *:http (LISTEN)
 apache2   22949             www-data    4u     IPv6              15516      0t0        TCP *:http (LISTEN)
 apache2   22950             www-data    4u     IPv6              15516      0t0        TCP *:http (LISTEN)
 apache2   22951             www-data    4u     IPv6              15516      0t0        TCP *:http (LISTEN)
 apache2   22952             www-data    4u     IPv6              15516      0t0        TCP *:http (LISTEN)
 apache2   22953             www-data    4u     IPv6              15516      0t0        TCP *:http (LISTEN)

이는 Unbuntu의 프로세스 이름이 실제로 httpd가 아니라 "apache2"임을 확인합니다.

답변2

당신이 원하는 것은 :

#systemctl status apache2   

아니요... httpd.

관련 정보