Moxa DA-710-XPE [35/73] Disabling the cgi function

Moxa DA-710-XPE [35/73] Disabling the cgi function
DA-710 Series Linux Managing Communications
3-10
Disabling the CGI Function
The CGI function is enabled by default. If you want to disable the function, modify the file
/etc/apache2/sites-available/default.
1. Mount the root file system with write permission.
MOXA:~# mount -o remount,rw /dev/hda1 /
2. Type # vi /etc/apache2/sites-available/default to edit the configuration file.
MOXA:/etc# vi /etc/apache2/sites-available/default
#ScriptAlias /cgi-bin/ /var/www/apache2-default/cgi-bin/
#<Directory "/var/www/apache2 default/cgi-bin/">
# AllowOverride None
# Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
# #Order allow,deny
# Order deny,allow
# Allow from all
#</Directory>
3. After you finish writing or modifying the code, remember to execute “umount /” to change the root directory
back to Read-only mode.
MOXA:~# umount /
4. Re-start the apache server.
MOXA:~# /etc/init.d/apache2 restart
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-710-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

Содержание

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

Скачать