Apacheをrpmでインストール

更新日 2012-10-16 (火) 11:28:46

Apacheの確認

以下のrpmがあればOK,なければインストール

apache2-manual-2.2.3-0vl3
apache2-2.2.3-0vl3
mod_ssl-apache2-2.2.3-0vl3

/etc/apache2にconf等のファイルがある。
/var/wwwにアクセスさせるホームページがある。

ユーザでの利用

デフォルトでは~userではアクセスできないので以下のようhttp.confを変更

<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
##    UserDir disable   <==コメントアウト

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disable" line above, and uncomment
    # the following line instead:
    #
    #UserDir public_html
    UserDir public_html <==コメントアウトを削除

</IfModule>

# 
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
          (以下コメントアウトを削除)
<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
       Order deny,allow
       Deny from all
    </LimitExcept>
</Directory>

その他の変更(http.conf)

##DirectoryIndex index.html index.html.var
DirectoryIndex index.html index.htm index.php index.cgi index.pl index.shtml
##LanguagePriority en ja 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
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

起動

/etc/rc.d/init.d/apache2 start

1.xがhttpdで起動してる場合は起動を停止する。

以下のファイル(MySQL,PostgreSQL)は Vine Plusにある

MySQLのインストール

# apt-get install mysql
# apt-get install mysql-client

必要に応じ mysql-XXXをインストール

PostgreSQLのインストール

# apt-get install postgresql
# apt-get install postgresql-server

いくつかのコマンドは/usr/binにある (createdb等)
環境ファイルは/var/lib/pgsql/dataにある

必要に応じ postgresql-XXXをインストール

phpのインストール

# apt-get install php5-apache2
# apt-get install php5-pgsql
# apt-get install php5-mysql

php.ini等は/etc/php5のしたにある

設定内容はソースからインストールと同じように行う

注)indexの拡張子の表示順序はhttpd.confでよりphpについてはconf.d/php5.confの以下の部分が優先されるためコメントアウトする

# DirectoryIndex index.php index.phtm

php.iniについての注意

php.iniの最後にVineで追加された項目がある。

[Vine]
output_buffering = Off
expose_php = Off
;;memory_limit = 32M
memory_limit = 512M
variables_order = "GPCS"
;;default_charset = EUC-JP
extension_dir = /usr/lib/php5

この部分のdefault_charset = EUC-JPが有効だと、送られたHTTPのヘッダーに

Content-Type: text/html; default_charset=EUC-JP

が無条件で付き、作成したphpファイルのヘッダーに

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

と記入してもutf-8としてブラウザが判断しないので、文字化けになるので コメントアウトしておく。文字コードはphpファイルで指定するようにしておく

その他メモリの指定もここにされているので注意する


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS