Get the real IP of a visitor, when your website is using CloudFlare
<?php
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
?>
Get the real IP of a visitor, when your website is using CloudFlare
<?php
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
?>
<?php
$baseUrl = $_SERVER['REQUEST_SCHEME']."://".$_SERVER['SERVER_NAME'];
if ($_SERVER['SERVER_PORT'] != '80') $baseUrl .= ":".$_SERVER['SERVER_PORT'];
define("BASE_URL", $baseUrl);
<?
A input group with 2 text inputs / demo here: http://jsfiddle.net/rjj0x1sm/
<div class="input-group" id="unified-inputs">
<input type="text" class="form-control" placeholder="Input1" />
<input type="text" class="form-control" placeholder="Input2" />
</div>
This configuration you have to pass in the Custom configuration textarea for hosting CakePHP Framework on Ajenti panel.
Please note that in the general tab your Path must end with "app/webroot/".
# Not found this on disk?
# Feed to CakePHP for further processing!
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
Add this code before </head>
:
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
Add this in your .htaccess
file:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
I hereby claim:
To claim this, I am signing this object:
Instead of searching on the ajenti.org website every time i want to install it, i copy and paste the code from this page.
wget -O- https://raw.github.com/Eugeny/ajenti/master/scripts/install-ubuntu.sh | sudo sh
You may need apt-get remove apache2
, and finaly
apt-get install ajenti-v ajenti-v-nginx ajenti-v-mysql ajenti-v-php-fpm php5-mysql
service ajenti restart
Install the json rest api wordpress plugin.
Include the following function in app/Controller/AppController.php
in your CakePHP instalation.
protected function _wpAPI($method='get', $url='/', $data=null)
{
App::uses('HttpSocket', 'Network/Http');
$http = new HttpSocket();
$http->configAuth('Basic', 'admin', 'password');