Skip to content
Snippets Groups Projects
Commit 50bfd04a authored by ale's avatar ale Committed by lucha
Browse files

Switch apache2-noblogs port to :92

parent f7a9ce16
No related branches found
No related merge requests found
......@@ -11,6 +11,9 @@ $noblogs_master = parse_url($master_url)['host'];
define('WP_CACHE',false);
require_once('/opt/noblogs/www/wp-load.php');
// Port that the noblogs apache2 instance is listening on (as a string).
define('NOBLOGS_PORT','92');
// Return all blogs.
function get_blogs() {
global $wpdb;
......@@ -26,10 +29,10 @@ function printline($s) {
function backend_to_http_endpoint($backend) {
if (substr($backend, 0, 8) != 'backend_') {
error_log('diamine, di questo backend non so che farmene: ' . $backend);
return $noblogs_master . ':82';
return $noblogs_master . ':' . NOBLOGS_PORT;
}
$id = substr($backend, 8);
return '172.16.1.' . $id . ':82';
return '172.16.1.' . $id . ':' . NOBLOGS_PORT;
}
// Print the blog -> backend map.
......@@ -39,7 +42,7 @@ function generate_backend_map($blogs) {
$wpdb_hash = &$wpdb->hash_map;
printline('map $http_host $backend_noblogs {');
printline(' default http://' . $noblogs_master . ':82;');
printline(' default http://' . $noblogs_master . ':' . NOBLOGS_PORT . ';');
foreach ($blogs as $blog) {
$blog_id = $blog->blog_id;
if ($blog_id == 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment