Moxa TC-6110-T-LX [32/117] Disabling cgi

Moxa TC-6110-T-LX [32/117] Disabling cgi
TC-6110 Linux User's Manual Managing Communications
3-14
Disabling CGI
Support for CGI scripting is enabled by default. To disable it, follow the steps below.
1. Open the configuration file for editing (below, we use VI):
moxa@MOXA:~# vi /etc/apache2/sites-enabled/000-default
Then, comment out the following lines:
moxa@MOXA:~#/etc# vi /etc/apache2/sites-enabled/000-default
#ScriptAlias /cgi-bin/ /usr/lib/w3m/cgi-bin/
#<Directory “/usr/lib/w3m/cgi-bin/”>
# AllowOverride None
# Options ExecCGI -MultiViews +SymLinksIFOwnerMatch
# #Order allow,deny
# Order deny,allow
# Allow from all
#</Directory>
2. Re-start the apache server.
moxa@MOXA:~# sudo service apache2 restart
ATTENTION
If
you have CGI scripts you wish to transfer to the server, make sure you make the files executable. The
command for this is
the change mode command, chmod. To make a file read-
only but executable, you may
use the numerical combination
555. To make a file read only but available for editing by root, use the
numerical key
755. The syntax is as follows:
MOXA:~#chmod 555 /usr/lib/cgi-bin/[NAME OF YOUR FILE HERE]
Saving Web Pages to a USB Storage Device
Some applications may have web pages that take up a lot of storage 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 the Internet.
1. Connect the USB storage device to a USB port, and check where the device is mounted:
moxa@Moxa:~# sudo mount
2. Prepare the web pages and then save the entire /var/www directory to the appropriate USB storage device.
Normally, this should be
/media/usb0.
moxa@Moxa:~# sudo cp a /var/www/ media/usb0/
3. Now change the Document Root setting. Open the basic Apache config file in an editor:
moxa@MOXA:~# /etc# sudo vi /etc/apache2/sites-avaliable/default
4. To enable Apache to read your website from the USB device, you must change the DocumentRoot entry in
the Apache configuration file so that it points to the USB storage device. Navigate to the section beginning with
DocumentRoot, and change the directory that immediately follows to /media/usb0/www. For a standard,
unsecured html page, edit
/etc/apache2/sites-available/default as below.
DocumentRoot /media/usb0/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

Содержание

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

Скачать