From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,T_TVD_MIME_EPI autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 25483 invoked from network); 10 Dec 2020 00:06:55 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 10 Dec 2020 00:06:55 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id cf590e4d for ; Wed, 9 Dec 2020 19:06:51 -0500 (EST) Received: from mail.aisha.cc (mail.aisha.cc [108.61.81.40]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 8a2b88b5 for ; Wed, 9 Dec 2020 19:06:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aisha.cc; s=excisionRSA; t=1607558808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=lExQanYezpd6DUiN1Wao9zevL+RRcIHWUGtPHMBukiU=; b=PeYXPyIxGkOZTx4N8pCEuMxC/15uiJyCD4YA8Ukg6JWL3PGvYATmk2Tqnfwfo61AUgfxN1 PcCAQTrGiv4cab4SQrk+CpowoAwv+ZDS8ohJHI8W5xaEZXuXyhRF/b3Li7Yh8lijUuKuD5 isDW6W/zBz1Rkws0TyVE1nIIjzIO8GQYnIXLYMhJ+vwKaMuOP1qIAR18gkobcJr257tRkv f0qV/lke1G7kYcln7r5RY1uHUosoPFXUSnLoJr/aMiH6e0VgiupT3dYUSRwSuHKZ+xGgna 3yKdKQz9mcBb02k8BNSf4rcEAmIypoca0CVy5sKDiCvELBdNBS3v40o9zOMcfA== Received: from [192.168.1.129] (c-73-215-141-174.hsd1.nj.comcast.net [73.215.141.174]) by mail.aisha.cc (OpenSMTPD) with ESMTPSA id b98400bb (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) auth=yes user=aisha@aisha.cc for ; Wed, 9 Dec 2020 19:06:47 -0500 (EST) To: discuss@mandoc.bsd.lv From: Aisha Tammy Organization: aisha.cc Subject: Help with setting up man.cgi with nginx Message-ID: <00b30a32-e90b-7f72-3120-63e0d38fe36a@aisha.cc> Date: Wed, 9 Dec 2020 19:06:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------15DADA7DF2464D71F4BC2746" Content-Language: en-US This is a multi-part message in MIME format. --------------15DADA7DF2464D71F4BC2746 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I was trying to set up man.cgi to view my manual pages online and haven't been able to find a lot of documentation for setting it up. I managed to get the main page to load but its not able to show any man pages, only the front page. I am on Gentoo and am using the nginx webserver. I am=C2=A0 using the fcgiwrap for passing to man.cgi. As man.cgi wants the /man folder to be present and nginx doesnt have chro= ot I had to symlink my /var/www/man to /man (as a temporary work around). the folder /man contains a single file - manpath.conf with just a single = line - system the /man/system directory contains man1/ man2/ ... folders with the man p= ages in them. But when I go to http://localhost , while I can see the main page, clicki= ng on any of the links man.cgi(8) or apropos(1) just shows the same page. Can anyone point out what I am missing. nginx.conf: user nginx nginx; worker_processes 1; error_log /var/log/nginx/error_log info; events { worker_connections 1024; use epoll; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" ' '"$gzip_ratio"'; client_header_timeout 10m; client_body_timeout 10m; send_timeout 10m; connection_pool_size 256; client_header_buffer_size 1k; large_client_header_buffers 4 2k; request_pool_size 4k; gzip off; output_buffers 1 32k; postpone_output 1460; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 75 20; ignore_invalid_headers on; server { server_name localhost; listen 127.0.0.1; location / { include fastcgi_params; fastcgi_pass 127.0.0.1:12345; fastcgi_param SCRIPT_FILENAME /var/www/cgi-bin/man.cgi; } } } fcgiwrap init script: #!/sbin/openrc-run ip=3D"0.0.0.0" port=3D"12345" start() { ebegin "Starting fcgiwrap process..." /usr/sbin/fcgiwrap -s tcp:$ip:$port & tcp_sock=3D`netstat -tulpn | grep fcgiwrap` eend $? "Errors were encountered while starting fcgiwrap process" } stop() { ebegin "Stopping fcgiwrap process..." pid=3D`ps a | grep fcgiwrap | grep tcp | cut -d" " -f1` kill -s 1 $pid tcp_sock=3D`netstat -tulpn | grep fcgiwrap` if test $tcp_sock =3D 2> /dev/null ; then echo "Fcgiwrap process successfully stoped" tcp_sock=3D`netstat -atulpn | grep $port` if test $tcp_sock =3D 2> /dev/null ; then echo "No open fcgiwrap connection found..." else echo "Wait to close fcgiwrap open connections...please verify with 'st= atus'" echo -e "Socket details: \n$tcp_sock" fi else echo "Fcgiwarp process is still running!" echo "Socket details: $tcp_sock" fi eend $? "Errors were encountered while stopping fcgiwrap process..." } status() { ebegin "Status fcgiwrap process..." tcp_sock=3D`netstat -atulpn | grep $port` if test $tcp_sock =3D 2> /dev/null ; then echo "Fcgiwrap process not running" else echo "Fcgiwarp process is running!" echo -e "Socket details: \n$tcp_sock" fi eend $? "Errors were encountered while stopping fcgiwrap process..." } --------------15DADA7DF2464D71F4BC2746 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi,
I was trying to set up man.cgi to view my manual pages online and
haven't been able to find a lot of documentation for setting it up.
I managed to get the main page to load but its not able to show any
man pages, only the front page.

I am on Gentoo and am using the nginx webserver.

I amĀ  using the fcgiwrap for passing to man.cgi.
As man.cgi wants the /man folder to be present and nginx doesnt have chroot
I had to symlink my /var/www/man to /man (as a temporary work around).

the folder /man contains a single file - manpath.conf with just a single line - system

the /man/system directory contains man1/ man2/ ... folders with the man pages in them.

But when I go to http://localhost , while I can see the main page, clicking on
any of the links man.cgi(8) or apropos(1) just shows the same page.

Can anyone point out what I am missing.

nginx.conf:
user nginx nginx;
worker_processes 1;

error_log /var/log/nginx/error_log info;

events {
	worker_connections 1024;
	use epoll;
}

http {
	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	log_format main
		'$remote_addr - $remote_user [$time_local] '
		'"$request" $status $bytes_sent '
		'"$http_referer" "$http_user_agent" '
		'"$gzip_ratio"';

	client_header_timeout 10m;
	client_body_timeout 10m;
	send_timeout 10m;

	connection_pool_size 256;
	client_header_buffer_size 1k;
	large_client_header_buffers 4 2k;
	request_pool_size 4k;

	gzip off;

	output_buffers 1 32k;
	postpone_output 1460;

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;

	keepalive_timeout 75 20;

	ignore_invalid_headers on;

        server {
		server_name localhost;
		listen 127.0.0.1;

		location / {
			include fastcgi_params;
			fastcgi_pass 127.0.0.1:12345;
			fastcgi_param  SCRIPT_FILENAME /var/www/cgi-bin/man.cgi;
		}
	}
}


fcgiwrap init script:
#!/sbin/openrc-run

ip="0.0.0.0"
port="12345"

start() {
	ebegin "Starting fcgiwrap process..."
	/usr/sbin/fcgiwrap -s tcp:$ip:$port &
	tcp_sock=`netstat -tulpn | grep fcgiwrap`
	eend $? "Errors were encountered while starting fcgiwrap process"
}

stop() {
	ebegin "Stopping fcgiwrap process..."
	pid=`ps a | grep fcgiwrap | grep tcp | cut -d" " -f1`
	kill -s 1 $pid
	tcp_sock=`netstat -tulpn | grep fcgiwrap`
	if test $tcp_sock =  2> /dev/null ; then
		echo "Fcgiwrap process successfully stoped"
		tcp_sock=`netstat -atulpn | grep $port`
		if test $tcp_sock =  2> /dev/null ; then
			echo "No open fcgiwrap connection found..."
		else
			echo "Wait to close fcgiwrap open connections...please verify with 'status'"
			echo -e "Socket details: \n$tcp_sock"
		fi
	else
		echo "Fcgiwarp process is still running!"
		echo "Socket details: $tcp_sock"
        fi
	eend $? "Errors were encountered while stopping fcgiwrap process..."
}

status() {
	ebegin "Status fcgiwrap process..."
	tcp_sock=`netstat -atulpn | grep $port`
	if test $tcp_sock =  2> /dev/null ; then
		echo "Fcgiwrap process not running"
	else
		echo "Fcgiwarp process is running!"
		echo -e "Socket details: \n$tcp_sock"
	fi
	eend $? "Errors were encountered while stopping fcgiwrap process..."
}


--------------15DADA7DF2464D71F4BC2746-- -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv