aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lasseter <nathan@4574.co.uk>2013-03-05 22:57:24 +0000
committerNathan Lasseter <nathan@4574.co.uk>2013-03-05 22:57:24 +0000
commita73b93840a71b39739563f116ca58040c90720b8 (patch)
tree3ab394b999d73cdd2d39d3b4eb73cc050f5a382a
parentdb38f8ec3c831685e7f9ed5a8a1bcf04f1d6b27f (diff)
All new instructions, licence, readme, sample files
-rw-r--r--LICENSE8
-rw-r--r--README20
-rw-r--r--htaccess.sample (renamed from .htaccess)0
-rw-r--r--nginx.sample26
4 files changed, 48 insertions, 6 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..3938007
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,8 @@
+Copyright (c) 2012, Nathan Lasseter (User_4574) user@4574.co.uk
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+-- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+-- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README b/README
index ada44fc..f2969fc 100644
--- a/README
+++ b/README
@@ -2,14 +2,22 @@ Clog
PHP blogging software
-Released unlicensed
+I wanted an exceptionally small piece of blogging software, where each post was simply a file, the title was the filename and the date was the modified time.
-The software is set up for FS root /var/www/ and Server Root /
-There are examples for /var/www/blog/ and /blog/
+This is that piece of software.
-Installation:
+Installation (Apache):
* Clone the repo
* Create a posts directory
-* Edit settings.php to your liking
+* Move settings.sample to settings.php and configure it
* Create a .htpasswd file for posting users
-* Edit .htaccess to point to .htpasswd and to perform the redirect correctly
+* 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 b/htaccess.sample
index 043a3e5..043a3e5 100644
--- a/.htaccess
+++ b/htaccess.sample
diff --git a/nginx.sample b/nginx.sample
new file mode 100644
index 0000000..ad5fa4f
--- /dev/null
+++ b/nginx.sample
@@ -0,0 +1,26 @@
+server {
+ listen 80;
+ server_name example.co.uk;
+
+ index index.php index.html index.htm;
+ autoindex on;
+
+ root /var/www;
+
+ rewrite \/post\/(.*)$ /viewpost.php?post=$1;
+ location /dopost.php {
+ auth_basic "Login to post";
+ auth_basic_user_file /var/www/.htpasswd;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/dopost.php;
+ }
+
+ location ~ \.php$ {
+ include /etc/nginx/fastcgi_params;
+ fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name;
+ }
+}