8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apache起動時に他のプロセスのポートと被ってエラーが出た場合

Last updated at Posted at 2015-06-20

apacheを起動しようとして

service httpd start

すると以下のようなエラーが

 httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

他のプロセスがそのポート(上記の場合80)を使ってるので、
そのプロセスをkillしてやる。
以下のコマンドで被っているプロセスを特定

netstat -lnp | grep :80  

結果

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1531/nginx

最後にあるのがプロセス番号なので

kill -9 1531

これで大丈夫なはずだが、もう一度netstatで確認しておく。
そして

service httpd start

で無時起動

8
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?