From 41de7bd89f56ffd1555772390aa14bfb5d542967 Mon Sep 17 00:00:00 2001 From: Conrad Sollitt Date: Mon, 27 Dec 2021 02:14:17 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Update=20for=20new=20Server=20an?= =?UTF-8?q?d=20move=20Public=20Folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Playground Server Setup.txt | 2 +- index.php | 6 +++--- {html => public}/favicon.ico | Bin {html => public}/index.php | 0 {html => public}/robots.txt | 0 scripts/app-quick-site-create.php | 2 +- scripts/delete-expired-sites.php | 2 +- scripts/sync-server-from-github.sh | 10 +++++----- 8 files changed, 11 insertions(+), 11 deletions(-) rename {html => public}/favicon.ico (100%) rename {html => public}/index.php (100%) rename {html => public}/robots.txt (100%) diff --git a/docs/Playground Server Setup.txt b/docs/Playground Server Setup.txt index a6c4a0f..0993451 100644 --- a/docs/Playground Server Setup.txt +++ b/docs/Playground Server Setup.txt @@ -139,7 +139,7 @@ unzip 1.0.0.zip cp -r ~/playground-master/app /var/www/app cp -r ~/playground-master/app_data /var/www/app_data cp -r ~/playground-master/scripts /var/www/scripts -cp -r ~/playground-master/html/. /var/www/html +cp -r ~/playground-master/public/. /var/www/html # Copy FastSitePHP Framework # Note - Normally this would be installed using [scripts/install.php], however diff --git a/index.php b/index.php index 065f252..0594caa 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ // redirects to the [html] directory which is used as the // public root directory on the production web server. -// On the main site the public web location is [/var/www/html] +// On the main site the public web location is [/var/www/public] // so the [.htaccess] files for user sites are configured for the // specific path, because this site uses specific [.htaccess] files // running in development is recommended for the PHP built-in Web Server @@ -18,11 +18,11 @@ // php -S localhost:3000 // // Then open your web browser to: -// http://localhost:3000/playground/html/ +// http://localhost:3000/playground/public/ // // This assume the following folder structure: // - fastsitephp "Root Directory" // - fastsitephp Repository // - playground Repository (this project) -header('Location: html/'); +header('Location: public/'); diff --git a/html/favicon.ico b/public/favicon.ico similarity index 100% rename from html/favicon.ico rename to public/favicon.ico diff --git a/html/index.php b/public/index.php similarity index 100% rename from html/index.php rename to public/index.php diff --git a/html/robots.txt b/public/robots.txt similarity index 100% rename from html/robots.txt rename to public/robots.txt diff --git a/scripts/app-quick-site-create.php b/scripts/app-quick-site-create.php index f1ec335..b9cd096 100644 --- a/scripts/app-quick-site-create.php +++ b/scripts/app-quick-site-create.php @@ -43,7 +43,7 @@ // Build a random hex string for the site $site = bin2hex(random_bytes(10)); - $copy_to = __DIR__ . '/../html/sites/' . $site . '/'; + $copy_to = __DIR__ . '/../public/sites/' . $site . '/'; // Copy files mkdir($copy_to . '/app', 0777, true); diff --git a/scripts/delete-expired-sites.php b/scripts/delete-expired-sites.php index 1a2a529..0201887 100644 --- a/scripts/delete-expired-sites.php +++ b/scripts/delete-expired-sites.php @@ -13,7 +13,7 @@ // Modify [SITES_DIR] as needed for testing locally or using on a different server. // const SITES_DIR = 'C:\Users\Administrator\Documents\Temp\FastSitePHP\Playground\html\sites\\'; -const SITES_DIR = '/var/www/html/sites/'; +const SITES_DIR = '/var/www/public/sites/'; define('LOG_FILE', SITES_DIR . '../../app_data/delete-sites-last-result.txt'); if (php_sapi_name() === 'cli') { diff --git a/scripts/sync-server-from-github.sh b/scripts/sync-server-from-github.sh index 3c802eb..f0621c3 100644 --- a/scripts/sync-server-from-github.sh +++ b/scripts/sync-server-from-github.sh @@ -8,7 +8,7 @@ # are confirmed. # # To run: -# bash /var/www/scripts/sync-server-from-github.sh +# bash /var/www/fastsitephp-playground/scripts/sync-server-from-github.sh # # For testing with [rsync] use [-n = --dry-run] # Example: @@ -22,10 +22,10 @@ rm ~/master.zip wget https://github.com/fastsitephp/fastsitephp/archive/master.zip -O ~/master.zip unzip -q ~/master.zip rm ~/master.zip -rsync -rcv --delete ~/playground-master/app/ /var/www/app -rsync -rcv --delete ~/playground-master/app_data/template/ /var/www/app_data/template -rsync -rcv --delete ~/playground-master/scripts/ /var/www/scripts -rsync -rcv --delete --exclude sites ~/playground-master/html/ /var/www/html +rsync -rcv --delete ~/playground-master/app/ /var/www/fastsitephp-playground/app +rsync -rcv --delete ~/playground-master/app_data/template/ /var/www/fastsitephp-playground/app_data/template +rsync -rcv --delete ~/playground-master/scripts/ /var/www/fastsitephp-playground/scripts +rsync -rcv --delete --exclude sites ~/playground-master/public/ /var/www/fastsitephp-playground/public rsync -rcv --delete ~/fastsitephp-master/src/ /var/www/vendor/fastsitephp/src rm -r ~/playground-master rm -r ~/fastsitephp-master