AH00059: Remove it before continuing if it is corrupted.
$ httpd -k start
(13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid
AH00059: Remove it before continuing if it is corrupted.
$ httpd -k start
(13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid
AH00059: Remove it before continuing if it is corrupted.
デフォルト設定
root権限が必要な下記の場所へ保存する設定になっています。
/run/httpd/httpd.pid
/run/httpd/httpd.pid
/run/httpd/httpd.pid
変更内容
PidFile(一般ユーザにpermissionがある保存場所)
PidFile (一般ユーザにpermissionがある保存場所)
PidFile (一般ユーザにpermissionがある保存場所)
2.ログファイル保存場所にroot権限が必要
エラーログ
$ httpd -k start
(13)Permission denied: AH00091: httpd: could not open error log file /etc/httpd/logs/error_log.
AH00015: Unable to open logs
$ httpd -k start
(13)Permission denied: AH00091: httpd: could not open error log file /etc/httpd/logs/error_log.
AH00015: Unable to open logs
$ httpd -k start
(13)Permission denied: AH00091: httpd: could not open error log file /etc/httpd/logs/error_log.
AH00015: Unable to open logs
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
CustomLog "logs/access_log" combined
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
CustomLog "logs/access_log" combined
変更内容
ErrorLog(一般ユーザにpermissionがある保存場所)
CustomLog(一般ユーザにpermissionがある保存場所) common
CustomLog(一般ユーザにpermissionがある保存場所) combined
ErrorLog (一般ユーザにpermissionがある保存場所)
CustomLog (一般ユーザにpermissionがある保存場所) common
CustomLog (一般ユーザにpermissionがある保存場所) combined
ErrorLog (一般ユーザにpermissionがある保存場所)
CustomLog (一般ユーザにpermissionがある保存場所) common
CustomLog (一般ユーザにpermissionがある保存場所) combined
3.ListenするポートがWell-Knownポート
エラーログ
$ httpd -k start
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
$ httpd -k start
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
$ httpd -k start
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
@@ -39,7 +39,12 @@
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
-Listen 80
+Listen 10080
+
+PidFile /home/UserName/httpd/httpd.pid
+
+DefaultRuntimeDir /home/UserName/httpd
#
# Dynamic Shared Object (DSO) Support
@@ -93,6 +98,7 @@
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
+ServerName localhost
#
# Deny access to the entirety of your server's filesystem. You must
@@ -179,7 +185,8 @@
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
-ErrorLog "logs/error_log"
+ErrorLog /home/UserName/httpd/error_log
#
# LogLevel: Control the number of messages logged to the error_log.
@@ -209,12 +216,14 @@
# logged therein and *not* in this file.
#
#CustomLog "logs/access_log" common
+ CustomLog /home/UserName/httpd/access_log common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
- CustomLog "logs/access_log" combined
+ CustomLog /home/UserName/httpd/access_log combined
</IfModule>
<IfModule alias_module>
@@ -39,7 +39,12 @@
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
-Listen 80
+Listen 10080
+
+PidFile /home/UserName/httpd/httpd.pid
+
+DefaultRuntimeDir /home/UserName/httpd
#
# Dynamic Shared Object (DSO) Support
@@ -93,6 +98,7 @@
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
+ServerName localhost
#
# Deny access to the entirety of your server's filesystem. You must
@@ -179,7 +185,8 @@
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
-ErrorLog "logs/error_log"
+ErrorLog /home/UserName/httpd/error_log
#
# LogLevel: Control the number of messages logged to the error_log.
@@ -209,12 +216,14 @@
# logged therein and *not* in this file.
#
#CustomLog "logs/access_log" common
+ CustomLog /home/UserName/httpd/access_log common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
- CustomLog "logs/access_log" combined
+ CustomLog /home/UserName/httpd/access_log combined
</IfModule>
<IfModule alias_module>
動作確認
$ httpd -k start
$ ps aux | grep httpd
UserName 101610.00.02898285128 ? Ss 17:160:00 httpd -k start
ディスカッション
コメント一覧
まだ、コメントがありません