MySQL PAM Config set up database table and column name for username and password # vim /etc/pam.d/nginx auth required pam_mysql.so user=USERNAME_HERE \ passwd=PASSWORD_HERE \ host=HOSTNAME_HERE \ db=DATABASE_HERE \ table=TABLE_OR_VIEW_NAME_HERE \ usercolumn=USERNAME_COLUMN \ passwdcolumn=PASSWORD_COLUMN \ crypt=0 sqllog=0 # repeat …. with config above account required pam_mysql.so user=USERNAME_HERE \ …….. crypt=0 sqllog=0 # alternatively, to external config file …
Recently I was assigned to a task about adding a file upload feature to a existing nginx server on CentOS. Nginx was chosen years ago because it simply handles some static files only. If the file upload was a requirement, using apache is simpler as computation power isn’t a constraint in our case. Background CentOS 7 …
CentOS 6 1. 移除sendmail 安裝postfix # /etc/init.d/sendmail stop # yum remove sendmail # yum install postfix cyrus-sasl mailx 2. Gmail username and password Simple Authentication and Security Layer (SASL) # echo “smtp.gmail.com GMAIL_USERNAME:GMAIL_PASSWORD” > /etc/postfix/sasl_passwd # chmod 600 /etc/postfix/sasl_passwd # postmap hash:/etc/postfix/sasl_passwd 3. Postfix 設定 vim /etc/postfix/main.cf myhostname = xxxx.hang321.net mydomain = hang321.net # use Gmail SMTP …
當設定 Jenkins 時發現沒有JAVA_HOME, 正奇怪明明已經安裝了Open JDK 7. 原來未安裝devel packages. yum install java-1.7.0-openjdk-devel -y 然後加上java.sh 到 /etc/profile.d [ -z “$JAVA_HOME” ] && JAVA_HOME=”/usr/lib/jvm/java” export JAVA_HOME Maven: link from https://maven.apache.org/download.cgi wget http://apache.mirror.digitalpacific.com.au/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz tar zxvf apache-maven-3.3.3-bin.tar.gz -C /usr/local ln -s /usr/local/apache-maven-3.3.3 /usr/local/maven vim /etc/profile.d/maven.sh #add following lines to maven.sh export M2_HOME=/usr/local/maven export M2=$M2_HOME/bin PATH=$M2:$PATH Ant: links from https://ant.apache.org/bindownload.cgi wget http://mirror.ventraip.net.au/apache//ant/binaries/apache-ant-1.9.5-bin.tar.gz …
Created a base image and wanna fork for specific purpose, then eth0 (bridge) & eth1 (host-only) have no IP. reason: VMware Player automatically assigned new MAC address, yet CentOS does not aware solutions: – remove /etc/udev/rules.d/70-persistent-net.rules – edit /etc/sysconfig/network-scripts/ifcfg-eth0 (and/or eth1) , remove line UUID=…. and HWADDR=…. – reboot

