diff --git a/config-sample.php b/config-sample.php deleted file mode 100755 index a2582b92..00000000 --- a/config-sample.php +++ /dev/null @@ -1,39 +0,0 @@ - diff --git a/create.php b/create.php deleted file mode 100755 index 42fccd25..00000000 --- a/create.php +++ /dev/null @@ -1,158 +0,0 @@ - /dev/null"; -$result = system($command); - -//Error check -if ($result != '') { - die("\nError encountered while extracting latest wordpress in directory " . $domain['rootdir'] . "\n"); -} - -$command = "mv " . $domain['htdocs'] . "/wordpress/* " . $domain['htdocs'] . "/"; -echo "\n COMMAND :: $command \n"; -$result = system($command); - -//Error check -if ($result != '') { - die("\nError encountered while moving latest wordpress in directory " . $domain['rootdir'] . "\n" . $result); -} - -/** - * MySQL Creation - */ - -$command = "mysql -h " . $local_env['mysql_host'] . " -u " . $local_env['mysql_user'] . " -p" . $local_env['mysql_pass'] . " -e 'create database `'" . $domain['name'] . "'` '"; -$result = system($command); - -/* - * Create wp-config.php - */ -$wp_config_sample = $domain['htdocs'] . "/wp-config-sample.php"; - -$command = "sed s/database_name_here/{$domain['name']}/ $wp_config_sample | sed s/username_here/{$local_env['mysql_user']}/ | sed s/password_here/{$local_env['mysql_pass']}/ > {$domain['htdocs']}/wp-config.php"; - -$result = system($command); - -/** - * Chown - */ -$command = "chown -R " . $local_env['nginx_user'] . ":" . $local_env['nginx_group'] . " " . $domain['rootdir']; -echo "\n COMMAND :: $command \n"; -$result = system($command); - -//Error check -if ($result != '') { - die("\nError encountered while charging owner of " . $domain['rootdir'] . "\n" . $result); -} - - -/** - * ALL SEENS WELL - Restart nginx - */ -echo "\n Relaoding nginx configuration...\n\n"; -system('service nginx reload'); - -/** - * THE END - */ -//just echo URL for new domain like http://$domain -//user will click it and verify if its working fine! ;-) - -echo $domain['name'] . " Successfully created\n\n"; - -?> diff --git a/example.com b/example.com deleted file mode 100755 index 92244579..00000000 --- a/example.com +++ /dev/null @@ -1,22 +0,0 @@ -server{ - server_name www.example.com example.com; - - access_log /var/log/nginx/example.com.access.log ; - error_log /var/log/nginx/example.com.error.log; - - root /var/www/example.com/htdocs; - index index.php index.html index.htm; - - ## PHP with FATSCGI - location ~ \.php$ { - include /etc/nginx/fastcgi_params; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - } - - #root dir - location / { - autoindex on; - try_files $uri $uri/ /index.php; - } -} diff --git a/init.php b/init.php deleted file mode 100755 index 28346bde..00000000 --- a/init.php +++ /dev/null @@ -1,54 +0,0 @@ - diff --git a/move.php b/move.php deleted file mode 100755 index 78590706..00000000 --- a/move.php +++ /dev/null @@ -1,156 +0,0 @@ - $domain - */ -function move_domain($usr_domain) { - global $local_env, $remote_env; - - if(trim($usr_domain) == ''){ - echo "\n CURRENT DOMAIN IS SKIPPED\n"; - return; - } - - /* - * Set domain environment values - */ - $domain['name'] = $usr_domain; - $domain['conf'] = $local_env['nginx_dir_sites_avilable'] . '/' . $domain['name']; - $domain['rootdir'] = $local_env['webroot'] . '/' . $domain['name']; - $domain['htdocs'] = $domain['rootdir'] . '/' . $local_env['htdocs'] ; - $domain['logs'] = $domain['rootdir'] . '/' . $local_env['logs'] ; - - /** - * Check if domain config file already exists - */ - if (file_exists($domain['conf'])) { - echo "\nConfiguration files for domain '" . $domain['name'] . "'already exists :: " . $domain['conf']; - echo "\nDo you want to overwrite previous configuration? [Y/N] (default=Y)"; - - if (in_array(strtolower(fgets(STDIN)), array('n', 'no'))) { - die("\nYou choose to terminate this script! Bye-Bye!!! \n"); - } - } - - /** - * At this point - either domain config file doesn't exist or user showed interest in overwriting it - * In either case... - * Create nginx conf for $domain in /etc/nginx/sites-available/$domain - * TODO :: Provide options to add supercache and/or w3total cache rules - */ - /** - * Create config file - */ - $nginx_conf = file_get_contents($local_env['default_conf']); - $nginx_conf = str_replace($local_env['default_domain'], $domain['name'], $nginx_conf); - file_put_contents($domain['conf'], $nginx_conf); - -//Error Check - if config file is created successfully or not - if (!file_exists($domain['conf'])) { - die("\nError encounterd while creating " . $domain['conf']); - } - - /** - * Linking config file - */ - echo "\nCreating Symbolic Link..\n"; - $command = "sudo ln -s " . $domain['conf'] . " " . $local_env['nginx_dir_sites_enabled']; - $result = system($command); - -//Error check - if linking config file succeed - if ($result != '') { - die("\nError encountered while creating script. Please check if file '" . $domain['conf'] . "'is created or not!\n"); - } - -//Go Ahead. -// echo "Nginx configuration for '" . $domain['name'] . "' is created successfully"; - - /** - * Create webroot dirs for new domain - */ -//create dirs - $result = system("mkdir " . $domain['rootdir']); - $result = system("mkdir " . $domain['htdocs']); - $result = system("mkdir " . $domain['logs']); - -//create log files - $result = system("touch " . $domain['logs'] . "/access.log"); - $result = system("touch " . $domain['logs'] . "/error.log"); - -//Error check - if ($result != '') { - die("\nError encountered while creating websites directories & files for " . $domain['name'] . "\n"); - } - - /** - * moving wordpress in new webroot dir - */ -//export remote db - $command = "rsync --exclude '*.iso' -avz {$remote_env['ssh_user']}@{$remote_env['host']}:{$remote_env['webroot']}/{$domain['name']}/htdocs/* {$domain['htdocs']}/"; - $result = system($command); - - - /** - * MySQL Moving - */ - $wp_config = get_defines($domain['htdocs'] . '/wp-config.php'); - - $command = "mysqldump -u {$wp_config['DB_USER']} -p{$wp_config['DB_PASSWORD']} -h {$remote_env['host']} --databases '{$wp_config['DB_NAME']}' > {$domain['rootdir']}/{$domain['name']}.sql"; -// echo "\n" . $command . "\n"; - $result = system($command); - - $command = "mysql -h {$local_env['mysql_host']} -u {$local_env['mysql_user']} -p{$local_env['mysql_pass']} < {$domain['rootdir']}/{$domain['name']}.sql"; -// echo "\n\n" . $command . "\n"; - $result = system($command); - - /* - * Create wp-config.php - */ - //this may not be needed as we already have wp-config.php present for remote WordPress - //@TODO we need to replace DB_HOST though - - - /** - * Chown - */ - $command = "chown -R " . $local_env['nginx_user'] . ":" . $local_env['nginx_group'] . " " . $domain['rootdir']; - echo "\n COMMAND :: $command \n"; - $result = system($command); - -//Error check - if ($result != '') { - die("\nError encountered while chaging owner of " . $domain['rootdir'] . "\n" . $result); - } -} -?> \ No newline at end of file diff --git a/remove.php b/remove.php deleted file mode 100755 index 25c64788..00000000 --- a/remove.php +++ /dev/null @@ -1,107 +0,0 @@ - \ No newline at end of file diff --git a/test.php b/test.php deleted file mode 100755 index a83076cf..00000000 --- a/test.php +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/touch.php b/touch.php deleted file mode 100755 index 1587dd02..00000000 --- a/touch.php +++ /dev/null @@ -1,99 +0,0 @@ - \ No newline at end of file