Open Source Web Development with LAMP Using Linux, Apache, MySQL, Perl, and PHP [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Open Source Web Development with LAMP Using Linux, Apache, MySQL, Perl, and PHP [Electronic resources] - نسخه متنی

James Lee, Brent Ware

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید










11.3 Apache Configuration


Apache must be configured to handle Mason much as with Embperl. We will choose a directory and for all l files under that directory, have Mason process them (for the same reasons, too).

First, create a directory for the Mason work:


$ mkdir /var/www/html/mason
$ chmod a+rx /var/www/html/mason

As root, add the following to /etc/httpd/conf/httpd.conf:


PerlSetVar MasonCompRoot /var/www/html/mason
PerlSetVar MasonDataDir /var/www/misc/mason
PerlModule HTML::Mason::ApacheHandler
<Directory /var/www/html/mason>
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</Directory>

The first line sets the Mason component root directory to /var/www/html/mason. This tells Mason where to find the components (more on these later). The data directory is set to /var/www/misc/mason. The Mason data directory should not be under the HTML root directory (/var/www/html), because we want to hide the Mason data files from the Web surfer visiting our site. The data directory contains data files that Mason uses, so we have picked an innocuous place for Mason to put them. You do not have to create this directory; it and all of its subdirectories are magically created for you.

Apache directives should be defined for the directory /var/www/html/mason. They tell Apache to set the handler to perl-script and to use the HTML::Mason::ApacheHandler module for all files in the /var/www/html/mason directory.

Load the altered Apache configuration file:


# /etc/init.d/httpd graceful


/ 136