lainsafe/doc/lainsafe.1

95 lines
1.7 KiB
Groff
Raw Normal View History

2020-08-07 17:52:46 +00:00
.\"Manpage for lainsafe
.TH lainsafe 1
.SH NAME
lainsafe \- Simple file upload
.SH DESCRIPTION
lainsafe is a simple file upload server written in Perl + CGI.
It runs in a Web server (i.e. nginx) with a CGI handler
(i.e. fcgiwrap)
2020-10-20 13:48:23 +00:00
You also have to install the dependencies, in Debian:
2020-10-20 13:58:39 +00:00
.in +4n
.EX
2020-11-14 22:30:49 +00:00
apt install nginx libcgi-pm-perl fcgiwrap
2020-10-20 13:58:39 +00:00
.EE
2020-10-20 13:48:23 +00:00
2020-08-07 17:52:46 +00:00
.SH INSTALLATION
You can use any web server for running lainsafe. However, nginx is
recommended. The following configuration should work for nginx:
.I /etc/nginx/sites-enabled/lainsafe.conf
.in +4n
.EX
server
{
server_name lainsafe.foo.tld;
listen 80;
listen [::]:80;
client_max_body_size 100m; # max size 100MBs, change 10 to 100
# in upload.cgi in line 30
root /var/www/lainsafe;
location ~ \.cgi$ {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME /var/www/lainsafe/$fastcgi_script_name;
}
}
.EE
2020-10-20 13:48:23 +00:00
.PP
2020-08-07 17:52:46 +00:00
The document root will be /var/www/lainsafe (be sure to change it in
.I root
and
.I fastcgi_param SCRIPT_FILENAME if you're going to use another directory
2020-10-20 13:48:23 +00:00
You also have to give the .cgi files +x permissions:
2020-10-20 13:57:55 +00:00
.in +4n
.EX
chmod +x *.cgi
.EE
2020-10-20 13:48:23 +00:00
2020-10-20 13:57:55 +00:00
.PP
And also, create the "files" directory manually, and give it
2020-10-20 13:48:23 +00:00
permissions so the user that is running nginx (usually)
.I www-data
can write on it.
2020-11-14 22:30:49 +00:00
.EX
chown www-data:www-data files
.EE
2020-10-20 13:48:23 +00:00
.SH TROUBLESHOOTING
2020-10-20 14:00:20 +00:00
.SS 502 Bad Gateway
2020-10-20 13:48:23 +00:00
Probably you're missing the
.I CGI
dependence, so install it with CPAN or apt
2020-10-20 13:56:22 +00:00
.in +4n
.EX
cpan -i CGI
apt install libcgi-pm-perl
.EE
.PP
2020-10-20 13:48:23 +00:00
If you still get this problem, run
2020-10-20 13:56:22 +00:00
.in +4n
.EX
perl <file>.cgi
.EE
.PP
2020-10-20 13:48:23 +00:00
so perl can help you debug the problem.
2020-10-20 14:00:20 +00:00
.SS 403 is returned
2020-10-20 13:48:23 +00:00
You probably forgot to give the files execution permissions.