Use the Apache mod_env module to save sensitive information about PHP programs

Source: Internet
Author: User
Tags config variables

Apache Module mod_env

Description: Allows Apache to modify or erase environment variables sent to CGI scripts and SSI pages

Module Name: Env_module

Source file: mod_env.c

This module is used to control environment variables that are transmitted to CGI scripts and SSI pages.

The transmitted environment variable can come from a shell that invokes the httpd process, or from a variable set (set) or Undo (unset) in the configuration process.

setenv directives

Description: Set Environment variables

Syntax: setenv env-variable value

Scope: Server config, virtual host, directory,. htaccess

Overlays: FileInfo

Module: mod_env

Sets an environment variable that is routed to the CGI script and SSI pages.

Setenv Site_path/home/fdipzone/demosite

unsetenv directives

Description: Delete an environment variable

Syntax: Unsetenv env-variable [env-variable] ...

Scope: Server config, virtual host, directory,. htaccess

Overlays: FileInfo

Module: mod_env

Deletes one or more environment variables in an environment that is routed to CGI scripts and SSI pages.

Unsetenv Site_path site_path1 Site_path2

For more information on the Apache MOD_ENV module please see here

How to use:

In the PHP program, if you want to connect to the database, we will write a config file below to save the connection information of the database.

<?php return  
       
Array ('  
    database ' => array (  
        ' host '     => ' 192.168.1.1 ',  
        ' user '     => ') Fdipzone ',  
        ' password ' => ' 123456 ',  
    ),  
);  
       
? >

These are more sensitive information that can be saved using the Apache mod_env.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.