いつも危ない目にあってしまう。
カテゴリー
いつも危ない目にあってしまう。
cd ~/.config/openbox
cp lxde-rc.xml lxde-rc.xml.2015-02-15
pi@raspberrypi ~/.config/openbox $ diff -u lxde-rc.xml.2015-02-15 lxde-rc.xml --- lxde-rc.xml.2015-02-15 2015-02-15 10:51:01.259615834 +0900 +++ lxde-rc.xml 2015-02-15 10:59:02.852644081 +0900 @@ -213,22 +213,22 @@ <wrap>no</wrap> </action> </keybind> - <keybind key="W-F1"> + <keybind key="C-A-1"> <action name="Desktop"> <desktop>1</desktop> </action> </keybind> - <keybind key="W-F2"> + <keybind key="C-A-2"> <action name="Desktop"> <desktop>2</desktop> </action> </keybind> - <keybind key="W-F3"> + <keybind key="C-A-3"> <action name="Desktop"> <desktop>3</desktop> </action> </keybind> - <keybind key="W-F4"> + <keybind key="C-A-4"> <action name="Desktop"> <desktop>4</desktop> </action>
sudo apt-get install fcgiwrap spawn-fcgi
pi@raspberrypi /etc/nginx/sites-available $ diff -u default.org default --- default.org 2015-01-11 14:28:27.657198270 +0900 +++ default 2015-01-11 14:27:20.828190564 +0900 @@ -77,6 +77,17 @@ #location ~ /\.ht { # deny all; #} + # Userdir - cgi + location ~ ^/~([^/]+)/(.+\.cgi)$ { + if (!-f /home/$1/public_html/$2) { + rewrite ^ 404; + } + alias /home/$1/public_html/$2; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + fastcgi_index index.cgi; + fastcgi_param SCRIPT_FILENAME $request_filename; + include fastcgi_params; + } # Userdir - php location ~ ^/~([^/]+)/(.+\.php)$ { if (!-f /home/$1/public_html/$2) {
sudo /etc/init.d/fcgiwrap restart sudo /etc/init.d/nginx restart
cat > ~/public_html/does_work.cgi <<HERE #!/bin/bash cat << EOF Content-type: text/html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=iutf-8"> <TITLE>Building a report</TITLE> </HEAD> <BODY> CGI works! </BODY> </HTML> EOF HERE
chmod a+x ~/public_html/does_work.cgi
http://IPADDRESS/~pi/does_work.cgi