From b05cc0180d8dae5af2cc11860c3654cc0e45ed2b Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Sat, 7 Jun 2014 10:16:18 +0000 Subject: Refactoring and updated configs --- README | 8 +++----- htaccess.sample | 3 +-- nginx.sample | 4 +++- rss.php | 1 + settings.sample | 7 ++++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README b/README index f2969fc..e9daa11 100644 --- a/README +++ b/README @@ -6,18 +6,16 @@ I wanted an exceptionally small piece of blogging software, where each post was This is that piece of software. -Installation (Apache): +Installation (Common): * Clone the repo * Create a posts directory * Move settings.sample to settings.php and configure it * Create a .htpasswd file for posting users + +Installation (Apache): * Create an Apache virtual host or .htaccess file based on htaccess.sample * (Optional) delete .sample files Instructions (nginx): -* Clone the repo -* Create a posts directory -* Move settings.sample to settings.php and configure it -* Create a .htpasswd file for posting users * Create an nginx server based on nginx.sample * (Optional) delete .sample files diff --git a/htaccess.sample b/htaccess.sample index 043a3e5..42b34d4 100644 --- a/htaccess.sample +++ b/htaccess.sample @@ -1,12 +1,11 @@ RewriteEngine on +RewriteRule ^feed$ /rss.php RewriteRule ^post/(.*)$ /viewpost.php?post=$1 -#RewriteRule ^post/(.*)$ /blog/viewpost.php?post=$1 AuthType Basic AuthName "Secure" AuthUserFile /var/www/.htpasswd -# AuthUserFile /var/www/blog/.htpasswd Require Valid-User diff --git a/nginx.sample b/nginx.sample index ad5fa4f..f225b35 100644 --- a/nginx.sample +++ b/nginx.sample @@ -7,7 +7,9 @@ server { root /var/www; - rewrite \/post\/(.*)$ /viewpost.php?post=$1; + rewrite \/blog\/feed$ /blog/rss.php; + rewrite \/blog\/post\/(.*)$ /blog/viewpost.php?post=$1; + location /dopost.php { auth_basic "Login to post"; auth_basic_user_file /var/www/.htpasswd; diff --git a/rss.php b/rss.php index 6e9b1d9..25fb3b8 100644 --- a/rss.php +++ b/rss.php @@ -37,6 +37,7 @@ echo "]]>\n"; echo "\t\t\n"; echo "\t\t\t$rssAuthorName\n"; + if (isset($rssAuthorEmail)) echo "\t\t\t$rssAuthorEmail\n"; echo "\t\t\n"; echo "\t\n"; } diff --git a/settings.sample b/settings.sample index 59f63b2..0a8abe6 100644 --- a/settings.sample +++ b/settings.sample @@ -7,9 +7,10 @@ $blogPosts = "/var/www/posts/"; //Page title $blogTitle = "My Clog Blog"; -//Header title -$blogHead = $blogTitle; +$blogSubTitle = "It's awesome"; -//Twitter Creator +//Author Information $twitterCreator = "Example"; +$rssAuthorName = "A. N. Other"; +//$rssAuthorEmail = ""; //optional ?> -- cgit v1.2.3