Moxa DA-681-I-SP-LX [37/65] Saving web pages to a usb storage device

Moxa DA-681-I-SP-LX [37/65] Saving web pages to a usb storage device
DA-681 Linux Managing Communications
3-7
echo REMOTE_ADDR = $REMOTE_ADDR
echo REMOTE_USER = $REMOTE_USER
echo AUTH_TYPE = $AUTH_TYPE
echo CONTENT_TYPE = $CONTENT_TYPE
echo CONTENT_LENGTH = $CONTENT_LENGTH
Before you modify the homepage, use a browser (such as Microsoft Internet Explore or Mozilla Firefox) from
your PC to test if the Apache web server is working. Type the LAN1 IP address in the browser’s address box to
open the homepage. For example, if the default IP address 192.168.3.127 is still active, type:
http://192.168.3.127/
To test the default CGI page, type:
http://192.168.3.127/cgi-bin/index.cgi
ATTENTION
When
you develop your own CGI application, make sure your CGI file is executable.
Saving Web Pages to a USB Storage Device
Some applications may have web pages that take up a lot of memory space. This section describes how to save
web pages to the USB mass storage device, and then configure the Apache web servers DocumentRoot to open
these pages. The files used in this example can be downloaded from Moxa’s website.
1. Prepare the web pages and then save the pages to the USB storage device. Click on the following link to
download the web page test suite: http://www.w3.org/MarkUp/Test/HTML401.zip.
2. Uncompress the zip file to your desktop PC, and then use FTP to transfer it to the
DA-681-LX’s /media/usb0 directory.
3. Mount the root file system with write permission.
MOXA:~# mount -o remount,rw /dev/hda1 /
4. Type # vi /etc/apache2/sites-available/default to edit the configuration file.
MOXA:/etc# vi /etc/apache2/sites-available/default
5. Change the DocumentRoot directory to the USB storage directory /media/usb0/www.
...
<VirtualHost *:80>
...
...
DocumentRoot /media/usb0/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
...
...
ScriptAlias /cgi-bin/ /media/usb0/www/cgi-bin/
<Directory "/media/usb0/www/cgi-bin/">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny

Содержание

Похожие устройства

Скачать