facebook twitter hatena line email

「Linux/apacheインストール」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(接続先webサーバがPermissionとなる場合)
(ip制限)
行26: 行26:
 
.htaccess
 
.htaccess
 
<pre>
 
<pre>
    Order Deny,Allow
+
Order Deny,Allow
    # AhrefsBot
+
# AhrefsBot
    Deny from 51.222.253.0/24
+
Deny from 51.222.253.0/24
    AllowOverride All
+
AllowOverride All
    Allow from All
+
Allow from All
 
</pre>
 
</pre>
 
===ip制限ファイルのモジュール化の場合===
 
===ip制限ファイルのモジュール化の場合===

2025年7月26日 (土) 10:07時点における版

インストール

# 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

ip制限

.htaccess

Order Deny,Allow
# AhrefsBot
Deny from 51.222.253.0/24
AllowOverride All
Allow from All

ip制限ファイルのモジュール化の場合

.htaccess

Include /etc/httpd/conf/extra/hoge_ip.conf
AllowOverride All
Allow from All

/etc/httpd/conf/extra/hoge_ip.conf

Order Deny,Allow
# AhrefsBot
Deny from 51.222.253.0/24