「Linux/apacheインストール」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==インストール== # yum install httpd ==起動== # /etc/rc.d/init.d/httpd start ==ストップと再起動== # /etc/rc.d/init.d/httpd stop # /etc/rc.d/init.d/h...」) |
(→ip制限) |
||
| (同じ利用者による、間の6版が非表示) | |||
| 行5: | 行5: | ||
# /etc/rc.d/init.d/httpd start | # /etc/rc.d/init.d/httpd start | ||
| − | == | + | ==ストップと再起動と設定再読込== |
# /etc/rc.d/init.d/httpd stop | # /etc/rc.d/init.d/httpd stop | ||
# /etc/rc.d/init.d/httpd restart | # /etc/rc.d/init.d/httpd restart | ||
| + | # /etc/rc.d/init.d/httpd graceful | ||
==自動起動設定== | ==自動起動設定== | ||
| 行15: | 行16: | ||
==プロセス確認== | ==プロセス確認== | ||
ps ax | grep httpd | ps ax | grep httpd | ||
| + | |||
| + | ==接続先webサーバがPermissionとなる場合== | ||
| + | エラーメッセージ | ||
| + | (13)Permission denied: AH00035: access to /index.php denied because search permissions are missing on a component of the path | ||
| + | selinuxを切る | ||
| + | $ sudo setenforce 0 | ||
| + | |||
| + | ==.htaccess周り== | ||
| + | [[Apacheメモ]] [ショートカット] | ||
| + | |||
| + | ==ip制限== | ||
| + | .htaccess | ||
| + | <pre> | ||
| + | Order Allow,Deny | ||
| + | Allow from All | ||
| + | # AhrefsBot | ||
| + | Deny from 51.222.253.0/24 | ||
| + | </pre> | ||
| + | |||
| + | ===ip制限ファイルのモジュール化の場合=== | ||
| + | .htaccess | ||
| + | <pre> | ||
| + | Order Allow,Deny | ||
| + | Allow from All | ||
| + | Include /etc/httpd/conf/extra/hoge_ip.conf | ||
| + | </pre> | ||
| + | |||
| + | /etc/httpd/conf/extra/hoge_ip.conf | ||
| + | <pre> | ||
| + | # AhrefsBot | ||
| + | Deny from 51.222.253.0/24 | ||
| + | </pre> | ||
2025年7月26日 (土) 11:04時点における最新版
目次
インストール
# yum install httpd
起動
# /etc/rc.d/init.d/httpd start
ストップと再起動と設定再読込
# /etc/rc.d/init.d/httpd stop # /etc/rc.d/init.d/httpd restart # /etc/rc.d/init.d/httpd graceful
自動起動設定
# /sbin/chkconfig httpd on # /sbin/chkconfig --list httpd
プロセス確認
ps ax | grep httpd
接続先webサーバがPermissionとなる場合
エラーメッセージ
(13)Permission denied: AH00035: access to /index.php denied because search permissions are missing on a component of the path
selinuxを切る
$ sudo setenforce 0
.htaccess周り
Apacheメモ [ショートカット]
ip制限
.htaccess
Order Allow,Deny Allow from All # AhrefsBot Deny from 51.222.253.0/24
ip制限ファイルのモジュール化の場合
.htaccess
Order Allow,Deny Allow from All Include /etc/httpd/conf/extra/hoge_ip.conf
/etc/httpd/conf/extra/hoge_ip.conf
# AhrefsBot Deny from 51.222.253.0/24
