0
0

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.

Macのhttpdでコンテンツはどこに置いたらいいのか調べた

0
Posted at

httpdを起動する

$ sudo apachectl start

ポートを確認する

$ grep Listen /usr/local/etc/httpd/httpd.conf 
# Listen: Allows you to bind Apache to specific IP addresses and/or
# Change this to Listen on specific IP addresses as shown below to 
# Listen 12.34.56.78:80
Listen 8080

ここで、http://localhost:8080 にアクセスして起動したことを確認します。

どのhttpdが動いているのか調べる

$ ps ax | grep httpd
53739   ??  Ss     0:00.16 /usr/local/opt/httpd/bin/httpd -k start
53741   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
53742   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
53743   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
53744   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
53745   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
53747   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
53778   ??  S      0:00.00 /usr/local/opt/httpd/bin/httpd -k start
54954 s005  R+     0:00.00 grep httpd

どのhttpd.confが使われているのかを調べる

$ /usr/local/opt/httpd/bin/httpd -V | grep SERVER_CONFIG_FILE
 -D SERVER_CONFIG_FILE="/usr/local/etc/httpd/httpd.conf"

コンテンツの置き場所を調べる

$ grep DocumentRoot /usr/local/etc/httpd/httpd.conf 
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/usr/local/var/www"
    # access content that does not live under the DocumentRoot.

というわけで、/usr/local/var/wwwにおけば良いことがわかる。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?