Programming language e.g. PHP, JAVASCRIPT, coding, web developing hints and skills applying on mobile device e.g. iphone
2012/03/12
use SSH connection for MYSQL
Do I need to open the port 3306 for MySQL server to accept outside connections if I use SSH connection?
Answer: No, you don’t need. The reason is you are making an SSH connection to the SSH server at your Amazon EC2 from your local computer (where the HeidiSQL is), not directly making a connection to MySQL server anymore. More precisely, you have to make sure your SSH is running (this is as I know the default config of Amazon), opening the default port for SSH to accept outside connections: port 22 and that’s it.
HeidiSQL specific question: How do I enter the params in the Heidi?
Answer:
In the ‘Settings’ tab
1. In the dropdown list of ‘Network type’, please select SSH tunnel
2. Hostname/IP: localhost (even you are connecting remotely)
3. Username & Password: your mysql user and password
Next, in the tab SSH Tunnel:
1. specify plink.exe or you need to download it and specify where it’s located
2. Host + port: the remote IP of your SSH server(should be MySQL server as well), port 22 if you don’t change anything
3. Username & password: SSH username (not MySQL users)
4. You might ignore the password in the above step if you have the .ppk file.
After that, you can test the connection. Hope it works!
2012/01/11
Cannot create `tag` table in Magento installation with sample data
彈出的ERROR
Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘USING BTREE,
KEY `FK_TAG_FIRST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`first’ at line 7
原來是MYSQL 5.0 和5.1 的SYNTAX問題, 升級到5.1可以解決問題, 或是用以下方法
solved this problem by changing:
PRIMARY KEY (`tag_id`) USING BTREE,
changed into
PRIMARY KEY USING BTREE (`tag_id`),
PRIMARY KEY (`tag_relation_id`) USING BTREE ,
changed into
PRIMARY KEY USING BTREE (`tag_relation_id`),
Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘USING BTREE,
KEY `FK_TAG_FIRST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`first’ at line 7
原來是MYSQL 5.0 和5.1 的SYNTAX問題, 升級到5.1可以解決問題, 或是用以下方法
solved this problem by changing:
PRIMARY KEY (`tag_id`) USING BTREE,
changed into
PRIMARY KEY USING BTREE (`tag_id`),
PRIMARY KEY (`tag_relation_id`) USING BTREE ,
changed into
PRIMARY KEY USING BTREE (`tag_relation_id`),
2012/01/10
改變sandbox testuser feedback score
原來可以出cheat 自行調教feedback score... 當然是在sandbox
api 名為 ValidateTestUserRegistration
<?xml version="1.0" encoding="utf-8"?>
<ValidateTestUserRegistrationRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<!-- Standard Input Fields -->
<FeedbackScore>500</FeedbackScore>
<RequesterCredentials>
<eBayAuthToken>token</eBayAuthToken>
</RequesterCredentials>
</ValidateTestUserRegistrationRequest>
api 名為 ValidateTestUserRegistration
<?xml version="1.0" encoding="utf-8"?>
<ValidateTestUserRegistrationRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<!-- Standard Input Fields -->
<FeedbackScore>500</FeedbackScore>
<RequesterCredentials>
<eBayAuthToken>token</eBayAuthToken>
</RequesterCredentials>
</ValidateTestUserRegistrationRequest>
2011/12/22
Apache2 Server 的啟用/重啟
Apache 常用小知識
Apache 的主要設定檔是 httpd.conf ,其他的設定檔都是被 Include 進來的;
Apache 的首頁目錄以 DocumentRoot 決定,首頁檔案則以 DirectoryIndex 決定;
Apache 可以透過虛擬主機的設定以指定不同主機名稱到不同的 DocumentRoot 下;
Apache 是多執行緒的軟體,可以啟動多個程序來負責 WWW。主要的模組有 prefork 及 worker, 最大可連線的數量以 MaxClients 來決定。
若要正確的讓瀏覽器顯示網頁的編碼格式,最好在網頁上宣告語系,並將 Apache 的設定檔 httpd.conf 內的 AddDefaultCharset 設定值取消;
在 Apache 可瀏覽的目錄權限設定上 (Options 參數),最好將 Indexes拿掉;
透過 AllowOverride 與 .htaccess 可讓使用者在自己管理的目錄下制訂自己的風格;
Apache 本身提供一個 apachectl (RedHat/CentOS) / rcapache (SUSE等) 的 script 讓使用者得以快速管理其 apache 的服務;
HTTP 使用的是明碼傳送,目前 WWW 可利用 SSL 等機制來進行資料加密的傳輸。資料如果比較重要時,務必以 SSL 或者是保護目錄來保護。
Apache2 Server 的啟用/重啟
對於不同的 Linux Distributions,Apache 啟用的方式略有不同,主要有三種(apachectl, httpd, apache2):
1.Shell>> /usr/local/apache2/bin/apachectl -k start (Red Hat)
2.
Shell>> /usr/local/apache2/bin/httpd -k start (when you don't have apachectl in Red Hat)
3.
Shell>> /etc/init.d/apache2 start (Ubuntu, Debian, SUSE)
訂閱:
文章 (Atom)