Diễn đàn Nhật Bản - diendannhatban.info
NHÀ PHÁT TRIỂN - DEVELOPERS - 技術開発 => HỆ ĐIỀU HÀNH => LINUX => Tác giả chủ đề:: admin trong Thứ tư, 28/09/2016, 08:13:11 am
-
1. Redhat / CentOS 6x
- Thiết lập env variable cho web server
# Cách 1: Config trực tiếp trên máy chủ
/etc/sysconfig/httpd
/etc/environment
# Cách 2: Dùng .bashrc hoặc .bash_profile (Cách này có thể dùng local cho MacOS, config trưc tiếp trên user)
export DDNB=ddnb.info
Memo
/etc/rc.d/init.d/functions
Tham khảo:
http://stackoverflow.com/questions/1641477/how-to-set-environment-variable-for-everyone-under-my-linux-system
https://wiki.archlinux.org/index.php/Environment_variables
https://serverfault.com/questions/233204/setting-server-variables-before-apache-loads/233227#233227
http://stackoverflow.com/questions/13568191/how-to-get-system-environment-variables-into-php-while-running-cli-apache2hand