Archive for the ‘Apache’ Category

* mod_vhost_alias | Apache | CentOS

Posted on 7 月 1st, 2008 by ひくら。. Filed under Apache, CentOS, Web.


mod_vhost_alias を試して見た。

通常 <VirtualHost> ~ </VirtualHost> でDocumentRootを設定するのだが、
このモジュールを使うとDocumentRootを動的に指定できる
例えば

ドメインが[ www.hikura.net ]の場合
設定されるDocumentRootは、[ /var/www/virtual/www.hikura.net/ ]になり

Read the rest of this entry »

.



* ServerTokens | Apache2.2

Posted on 6 月 10th, 2008 by ひくら。. Filed under Apache, CentOS, Web.


デフォルトでServerTokens は、OSになっています。
デフォルトのままだと以下のように表示されます。

————————————————–
Server: Apache/2.0.41 (Unix)
————————————————–

ただ、バージョンなどの情報は攻撃に有用な情報になりかねないので
できるだけ抑止するようにします。

Apache2.2
# vi /etc/httpd/conf/httpd.conf
————————————————–
ServerTokens Prod
————————————————–
にすることで以下のように表示されます。

————————————————–
Server: Apache
————————————————–

Read the rest of this entry »

.



* Apacheインストール | Apache2.2

Posted on 6 月 10th, 2008 by ひくら。. Filed under Apache, CentOS, Web.


■Apache2.2 yum install
今回は、すべてのパッケージをインストールします
※通常は不必要なパッケージを除いてインストールします。

▼パッケージリストの取得
# yum list | grep httpd
# yum list | grep php

▼Apache2.2のインストール
# yum -y install httpd*

■Apache設定
※念の為、設定ファイルはバックアップをとっておく事
# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.def
# vi /etc/httpd/conf/httpd.conf
————————————————–
### エラーページ等でOS名を表示しないようにする
ServerTokens Prod

### サーバー名を指定
ServerName ****.net:80

### Optionsディレクティブ設定
Options Includes FollowSymLinks ExecCGI MultiViews

### htaccessの設定権限
AllowOverride All

### バーチャルドメイン用設定
<Directory /home/*/www>
AllowOverride All
Options MultiViews SymLinksIfOwnerMatch Includes ExecCGI
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

### デフォルト
DirectoryIndex index.html index.php index.pl index.cgi

### エラーページ等でApacheのバージョンを表示しないようにする
ServerSignature Off

### CGIスクリプトに.plを追加
AddHandler cgi-script .cgi .pl

### ランゲージの優先順位を変更
LanguagePriority ja en ca cs da de el eo es et fr he hr it ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

<Directory “/var/www/icons”>
### 一覧で表示されないようにする
### Options Indexes MultiViews
Options MultiViews

# デフォルトのキャラセット指定
###AddDefaultCharset UTF-8

# 名前ベースのバーチャルホストを有効にする場合に使用します。
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html
ServerName *****.net
ErrorLog /var/log/httpd/psv76_preits_ne_jp-error.log
CustomLog /var/log/httpd/psv76_preits_ne_jp-access.log combined
</VirtualHost>
————————————————–
■詳細設定
▼ウェルカムページを表示させないようにする
# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.def

▼Perlのパス設定
/usr/local/bin/perlから/usr/bin/perlへリンクをはる
# ln -s /usr/bin/perl /usr/local/bin/perl

Perlのパスを確認
# whereis perl
■Apache起動&自動起動設定

▼Apache起動
# /etc/init.d/httpd start
httpd を起動中: [ OK ]

▼自動起動設定
# chkconfig httpd on
# chkconfig –list httpd

httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

.



Calendar

9 月 2010
« 9 月    
 1234
567891011
12131415161718
19202122232425
2627282930  

カテゴリー

最近の投稿

CentOS

UNIQLO CALENDAR

アーカイブ

Google AdSense