sebsauvage / ZeroBin

A minimalist, opensource online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES.
http://sebsauvage.net/wiki/doku.php?id=php:zerobin
952 stars 213 forks source link

Problems with installation #84

Closed sebie closed 9 years ago

sebie commented 9 years ago

The installation instructions, I think, are incorrect. After reading #80 I found out that you need a /tmp? Would anyone mind writing a guide as to how to install it?

Thanks,

Sebie

Mikaela commented 9 years ago

for me it was just cd /var/www/ and git clone https://github.com/sebsauvage/ZeroBin.git and configuring vhost to nginx (which is optional and git clone to web server directory should be enough).

My vhost configuration if it interests you is below.

server {
    listen 80;
    listen [::]:80;
    listen 443;
    listen [::]:443;

    root /var/www/ZeroBin/;
    index index.php index.html index.htm;

    server_name zero.mikaela.info zerobin.mikaela.info;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
        autoindex off;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
       fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #   # With php5-cgi alone:
    #    fastcgi_pass 127.0.0.1:9000;
    #   # With php5-fpm:
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       #include fastcgi_params;
       include fastcgi.conf;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
       deny all;
    }
}
sebie commented 9 years ago

Ok thanks for the reply, will try this later week (when I have time).

Popolon commented 9 years ago

In fact, you need to create two directories with writing permission for web server :

sebie commented 9 years ago

Mind providing steps on how you did it @sebsauvage ?

It would be appreciated greatly.

Popolon commented 9 years ago

Well, in my sense, this piece of software has great security concerns, because the directories tmp and data where you give the web server write permission countains (autogenerated) php scripts.

axilleas commented 9 years ago

I didn't encounter this issue those two dirs were created automatically. Perhaps if the dir doesn't have the right permissions, it gets skipped.

sebie commented 9 years ago

Might try it again, if it is working for y'all.

drewbeer commented 9 years ago

if you are using nginx, you should deny web access to /data/ and /tmp/ that way they are not browsable.

creafrog commented 9 years ago

Oh yeah tks 4 patch drewbeer ;)

sebie commented 9 years ago

Thanks for the help, I got it working for what I needed.