我在运行我的网络(+数据库)服务器Ubuntu 15.10。
一切都运行正常,但突然间我无法访问我的网站,也无法 ping 端口 80,443 也无法工作。
命令
service apache2 status
说
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: active (exited) since 금 2017-09-22 12:08:47 KST; 4h 41min ago
Docs: man:systemd-sysv-generator(8)
Process: 817 ExecStart=/etc/init.d/apache2 start (code=exited,status=0/SUCCESS)
Memory: 0B
CPU: 0
9월 22 12:08:46 dev apache2[817]: * Starting web server apache2
9월 22 12:08:47 dev apache2[817]: (98)Address already in use: AH0007 make_sock:...443
9월 22 12:08:47 dev apache2[817]: (98)Address already in use: AH00072: make_sock:...443
9월 22 12:08:47 dev apache2[817]: no listening sockets available, shutting down
9월 22 12:08:47 dev apache2[817]: AH00015: Unable to open logs
9월 22 12:08:47 dev apache2[817]: Action 'start' failed.
9월 22 12:08:47 dev apache2[817]: The Apache error log may have more information.
9월 22 12:08:47 dev apache2[817]: *
9월 22 12:08:47 dev systemd[1]: Started LSB: Apache2 web server.
9월 22 16:42:57 dev systemd[1]: Started LSB: Apache2 web server.
Hint: Some lines were ellipsized, use -l to show in full.
我尝试了服务 httpd 状态
root@dev:/etc/apache2# service httpd status
● httpd.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
结果如下。
我知道 Ubuntu 实际上没有httpd配置文件。
我检查发现没有其他服务正在使用端口 80 或 443。
有什么建议么?
其他一些结果:
dev@dev:/usr/local$ sudo ps -ef | grep apache2
dev 14346 13101 0 17:10 pts/0 00:00:00 grep --color=auto apache2
dev@dev:/usr/local$ sudo netstat -ltnp | egrep :'443|80'
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 709/sshd
tcp6 0 0 :::443 :::* LISTEN 709/sshd
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1214/java
tcp6 0 0 :::8009 :::* LISTEN 1214/java
tcp6 0 0 :::8080 :::* LISTEN 1214/java
答案1
从输出中可以看出,sshd
由于某种原因,您使用了端口 443,这是不寻常的。您可以将sshd
端口更改为其他值/etc/ssh/sshd_config
,然后重新启动sshd
和apache2
实例。