https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-The_Apache_HTTP_Server.html
1. List current allowed port
semanage port -l | grep -w http_port_t
http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000
2. Add another port
semanage port -a -t http_port_t -p tcp 12345
2014年10月17日 星期五
2014年9月30日 星期二
Android In App Billing Note
The Item that you were attempting to purchase could not be found, while download app from google play
1. check if the apk is uploaded and published aka 已發布 (even in Alpha stage)
in Developer Console, the Apk , right up corner
2. check the SKU name
3. IAB need to test in REAL device (not virutal device like AVD)
4. the google account of the test device can not same as the Developer Console's account
5. the test apk should use same version number and same key to signed as the uploaded apk
Android Developer Tools 23.0 Export APK Error
When Exporting APK, there are 3 kinds of error when using ADT 23.0
1. duplicate id @+id/image already defined earlier in this layout
2. This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView) : google-play-services_lib
3. "app_name" is not translated in af, am, ar, be, bg, ca, cs, da, de, el, en-rGB, en-rIN, es, es-rUS, et, et-rEE, fa, fi, fr, fr-rCA, hi, hr, hu, hy-rAM, in, it, iw, ja, ka-rGE, km-rKH, ko, lo-rLA, lt, lv, mn-rMN, ms, ms-rMY, nb, nl, pl, pt, pt-rBR, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr, uk, vi, zh-rCN, zh-rHK, zh-rTW, zu
to fix that Change Lint FATAL to Warring
Window -> Preference -> Android -> Lint Error Checking
Correctness -> DuplicateIds
Correctness -> Instantiatable
Correctness:Messages -> Missing Translation
2014年9月24日 星期三
Laravel Installation in CentOS
1. Installl Composer Globally
https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
2. Install Laravel
* Required PHP 5.4
For upgrade PHP 5.3 to PHP 5.4
composer global require "laravel/installer=~1.1"
3. add ~/.composer/vendor/bin into $PATH
4. create a new laravel project which name is "test" in /var/www/html
cd /var/www/html
laravel new test
5. give test/app/storage write permission to apache
6. add a virtual host in httpd.conf
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/test/public
ServerName laravel.example.com
ErrorLog logs/laravel-error_log
CustomLog logs/laravel-access_log common
AllowOverride All
7. browse http://localhost/
It should display "You have arrived."
8. edit config files
app/config/app.php'debug' => true, //for debug message
'timezone' => 'Asia/Taipei', //for timezone to Taipei
app/config/database.php
9. add a sample router
edit app/router.phpRoute::get('time', function()
{
return date("Y-m-d H:i:s");
});
browse http://localhost/time
CentOS 6.5 Upgarde PHP 5.3.3 to PHP 5.4
https://webtatic.com/packages/php54/
1.
=============================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================
Installing:
php54w x86_64 5.4.32-1.w6 webtatic 2.5 M
php54w-bcmath x86_64 5.4.32-1.w6 webtatic 34 k
php54w-cli x86_64 5.4.32-1.w6 webtatic 2.4 M
php54w-common x86_64 5.4.32-1.w6 webtatic 1.1 M
php54w-devel x86_64 5.4.32-1.w6 webtatic 2.4 M
php54w-gd x86_64 5.4.32-1.w6 webtatic 118 k
php54w-mbstring x86_64 5.4.32-1.w6 webtatic 918 k
php54w-mcrypt x86_64 5.4.32-1.w6 webtatic 25 k
php54w-mysql x86_64 5.4.32-1.w6 webtatic 110 k
php54w-pdo x86_64 5.4.32-1.w6 webtatic 94 k
php54w-pear noarch 1:1.9.4-7.w6 webtatic 389 k
php54w-tidy x86_64 5.4.32-1.w6 webtatic 29 k
php54w-xml x86_64 5.4.32-1.w6 webtatic 145 k
Removing:
php x86_64 5.3.3-27.el6_5.1 @updates 3.5 M
php-bcmath x86_64 5.3.3-27.el6_5.1 @updates 29 k
php-cli x86_64 5.3.3-27.el6_5.1 @updates 6.2 M
php-common x86_64 5.3.3-27.el6_5.1 @updates 2.9 M
php-devel x86_64 5.3.3-27.el6_5.1 @updates 3.0 M
php-gd x86_64 5.3.3-27.el6_5.1 @updates 324 k
php-mbstring x86_64 5.3.3-27.el6_5.1 @updates 2.1 M
php-mcrypt x86_64 5.3.3-3.el6 @epel 46 k
php-mysql x86_64 5.3.3-27.el6_5.1 @updates 216 k
php-pdo x86_64 5.3.3-27.el6_5.1 @updates 168 k
php-pear noarch 1:1.9.4-4.el6 @base 2.2 M
php-tidy x86_64 5.3.3-27.el6_5.1 @updates 48 k
php-xml x86_64 5.3.3-27.el6_5.1 @updates 307 k
Installing for dependencies:
pcre-devel x86_64 7.8-6.el6 base 318 k
t1lib x86_64 5.1.2-6.el6_2.1 base 160 k
Transaction Summary
=============================================================================================================================================================================
1.
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm2.
yum install yum-plugin-replace yum replace php-common --replace-with=php54w-common |
Package Arch Version Repository Size
=============================================================================================================================================================================
Installing:
php54w x86_64 5.4.32-1.w6 webtatic 2.5 M
php54w-bcmath x86_64 5.4.32-1.w6 webtatic 34 k
php54w-cli x86_64 5.4.32-1.w6 webtatic 2.4 M
php54w-common x86_64 5.4.32-1.w6 webtatic 1.1 M
php54w-devel x86_64 5.4.32-1.w6 webtatic 2.4 M
php54w-gd x86_64 5.4.32-1.w6 webtatic 118 k
php54w-mbstring x86_64 5.4.32-1.w6 webtatic 918 k
php54w-mcrypt x86_64 5.4.32-1.w6 webtatic 25 k
php54w-mysql x86_64 5.4.32-1.w6 webtatic 110 k
php54w-pdo x86_64 5.4.32-1.w6 webtatic 94 k
php54w-pear noarch 1:1.9.4-7.w6 webtatic 389 k
php54w-tidy x86_64 5.4.32-1.w6 webtatic 29 k
php54w-xml x86_64 5.4.32-1.w6 webtatic 145 k
Removing:
php x86_64 5.3.3-27.el6_5.1 @updates 3.5 M
php-bcmath x86_64 5.3.3-27.el6_5.1 @updates 29 k
php-cli x86_64 5.3.3-27.el6_5.1 @updates 6.2 M
php-common x86_64 5.3.3-27.el6_5.1 @updates 2.9 M
php-devel x86_64 5.3.3-27.el6_5.1 @updates 3.0 M
php-gd x86_64 5.3.3-27.el6_5.1 @updates 324 k
php-mbstring x86_64 5.3.3-27.el6_5.1 @updates 2.1 M
php-mcrypt x86_64 5.3.3-3.el6 @epel 46 k
php-mysql x86_64 5.3.3-27.el6_5.1 @updates 216 k
php-pdo x86_64 5.3.3-27.el6_5.1 @updates 168 k
php-pear noarch 1:1.9.4-4.el6 @base 2.2 M
php-tidy x86_64 5.3.3-27.el6_5.1 @updates 48 k
php-xml x86_64 5.3.3-27.el6_5.1 @updates 307 k
Installing for dependencies:
pcre-devel x86_64 7.8-6.el6 base 318 k
t1lib x86_64 5.1.2-6.el6_2.1 base 160 k
Transaction Summary
=============================================================================================================================================================================
2014年7月1日 星期二
CodeIgniter Installation
1. download CodeIgniter 3.0 release from github
2. extrace all the file into /var/www/html/CI
3. to remove index.php (http://127.0.0.1/Test instead of http://127.0.0.1/index.php/Test
A: modify httpd.conf, add a virtualhost with AllowOverride All
B: in /var/www/html/CI , add a .htaccess with rewrite rule
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images|assets|robots\.txt|$)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
C: modify config.php and set index_page to blank
$config['index_page'] = '';
4. In /var/www/html/CI/application/controllers
add a Test.phpclass Test extends CI_Controller {
public function index()
{
echo 'Hello World!';
}
}
?>
Browser : http://127.0.0.1/Test or http://127.0.0.1/index.php/Test
5. Install Ion Auth 2
download Ion Auth 2 from https://github.com/benedmunds/CodeIgniter-Ion-Authcopy controllers / language / libraries / models / views to /var/www/html/CI/application
rename files to support V3 UpperCaseFirst class name
config/ion_auth.php => config/Ion_auth.php
models/ion_auth_model.php => models/Ion_auth_model.php
models/ion_auth_mongodb_model.php => models/Ion_auth_mongodb_model.php
execute sqlremember to set Selinux , httpd_can_network_connect_db
setsebool -P httpd_can_network_connect_db 1
Browser : http://192.168.1.155:8080/Auth/
and Login with default email and password
6. Add CSS / JS Folder
mkdir /var/www/html/CI/assets
mkdir /var/www/html/CI/assets/css
mkdir /var/www/html/CI/assets/javascript
make sure in the .httaccess
RewriteCond $1 !^(index\.php|images|assets|robots\.txt|$)
in the view
<link type="text/css" rel="stylesheet" href="/assets/css/test.css" media="all" />
Apache AllowOverride in Virtual Host
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/default
ServerName dummy-host.example.com
ErrorLog logs/default-error_log
CustomLog logs/default-access_log common
AllowOverride All
in /var/www/html/default
[root@test-20140423 test]# ls -al /var/www/html/default/test/
總計 12
drwxr-xr-x. 2 root root 4096 2014-07-01 15:36 .
drwxr-xr-x. 3 root root 4096 2014-07-01 15:23 ..
-rw-r--r--. 1 root root 17 2014-07-01 15:36 .htaccess
[root@test-20140423 test]# more .htaccess
Options -Indexes
try to http://127.0.0.1/test/
Forbidden
You don't have permission to access /test/ on this server.
in error-log
[Tue Jul 01 15:38:37 2014] [error] [client 10.10.50.57] Directory index forbidden by Options directive: /var/www/html/default/test/
訂閱:
文章 (Atom)