2019年8月26日 星期一

PHP Security



#set up response header
<IfModule mod_headers.c>
Header set X-Frame-Options "SAMEORIGIN"
Header set Content-Security-Policy "default-src 'self'"
</IfModule>


https://adamschen9921.pixnet.net/blog/post/116879044-apache%E7%A7%BB%E9%99%A4%E9%87%8D%E8%A6%81%E8%B3%87%E8%A8%8Aheader

https://gist.github.com/phpdave/24d879514e7411047267

Net craft website

https://toolbar.netcraft.com/site_report?url=tympanus.net%2FBlueprints%2FMultiLevelMenu%2F

https://toolbar.netcraft.com/stats/topsites?c=JP&submit=Refresh

2019年8月22日 星期四

SSH web log tunnel, no need install browser in server

1. SSH
  • ssh -L 8080:remoteMachine.me:80 user@remoteMachine
Local port: 8080
remote port: 80


ref 1 2 3

2019年8月15日 星期四

php centos7 install mysql and pdo

1. install mysql package for php
ref  https://www.opencli.com/php/php-use-mysqlnd-replace-libmysql


libmysql 是 PHP 沿用已久的 MySQL driver, 而在 PHP 5.3 開始, PHP 內建了 PHP 專用連接 MySQL 的 Driver — mysqlnd, 而從 PHP 5.4 之後的版本, mysqlnd 更被 PHP 作為預設安裝選項。
如果在 RHEL / CentOS 下要安裝 mysqlnd, 可以用 yum 指令完成, 但由於 php-mysqlnd (mysqlnd) 與 php-mysql (libmysql) 不能共存, 所以安裝前要先移除 php-mysql.

# yum install php-mysqlnd



2 PHP7 install phpmyadmin


Ref 1









2019年8月14日 星期三

php install oracle connect

1.  Oracle Instant Client

Oracle Instant Client enables applications to connect to a local or remote Oracle Database for development and production deployment. The Instant Client libraries provide the necessary network connectivity, as well as basic and high end data features, to make full use of Oracle Database. It underlies the Oracle APIs of popular languages and environments including Node.js, Python and PHP, as well as providing access for OCI, OCCI, JDBC, ODBC and Pro*C applications. Tools included in Instant Client, such as SQL*Plus and Oracle Data Pump, provide quick and convenient data access.




2.  install




3 Step:
package: oci8-2.2.0
package: oracle-instantclient19.3-basic-19.3.0.0.0.0-1,
oracle-instantclient19.3-devel-19.3.0.0.0.1.x86_64.rpm,
oracle-instantclient19.3-sqlplus-193.30.0.01.x84_64.rpm


1. install rpm  for basic and develop, 
2. install oci8, 透過OCI8連到Oracle之範例說明
3. install php.d for oci8.ini
4. resta server

4. Good reference
linux centos centos7 安装oci8
CentOS下,裝Oci8
Oci_connect function is undefined in CentOS with Oracle


5. explain PHP INI
php ini chinese




2019年8月13日 星期二

Linux bash loop Problem

1. Problem:
This will cause the fork bomb if you in bashrc write
scl enable XXX

bash fork retry: no child processes

2. solution Logout
killall -KILL -u user1

Install apache and php

1. 安裝 1

Simple install 1
https://dywang.csie.cyut.edu.tw/dywang/rhce7/node71.html



2. Bird and detail content Install 2

http://linux.vbird.org/linux_server/0360apache.php#www_basic_basic



3. Quick install 

https://www.opencli.com/linux/redhat-centos-7-setup-apache-mariadb-php