1

(3 odpowiedzi, napisanych Oprogramowanie / Software)

Wystarczy dodać do firewall.user:

iptables -I FORWARD 1 -p tcp -d 151.101.14.27 -j REJECT

i zrestartować firewall?
Co mogło być przyczyną tego połączenia, gdzie wyparowały te dane? W firefox aktywna była zakładka google mapy (3d), byłem także zalogowany w dwóch sklepach internetowych.
Jak zabezpieczyć się przed taką sytuacją w przyszłości tylko z innym adresem?

Od kilku miesięcy korzystam z limitowanego LTE orange - nju. Dziś dostałem powiadomienie o kończącym pakiecie danych. Wchodzę sprawdzić co się dzieje, a tu lecą sobie dane z adresu 151.101.14.27:443. W sumie w ciągu 3 godzin zjadło 30GB, szło to na komputer z ubuntu. Nic ciekawego o adresie nie mogę znaleźć. Na routerze LEDE. Jak zabezpieczyć się przed takimi niespodziankami?

3

(16 odpowiedzi, napisanych Oprogramowanie / Software)

Słusznie, dziękuję za odpowiedź, zrobiłem jak mówisz, mniej więcej tak i działa:

scp user@192.168.1.2:/home/user/rfs1.ubi /tmp/
umount -t /dev/ubi0_1
ubiupdatevol /dev/ubi0_1 /tmp/rfs1.ubi
reboot

4

(16 odpowiedzi, napisanych Oprogramowanie / Software)

W /tmp zmieści się gdy wpiszemy:

root@(none):~# mount -t tmpfs -o remount,rw,nosuid,nodev,noatime,size=256M tmpfs /tmp

ale nie da się tego z powrotem wgrać:

root@(none):~# dd if=/tmp/rfs1.ubi of=/dev/ubi0_1
dd: writing '/dev/ubi0_1': Operation not permitted
1+0 records in
0+0 records out

Chyba muszę przeprosić extroot... .

5

(16 odpowiedzi, napisanych Oprogramowanie / Software)

Gdzie to można zapisać:

root@(none):~# dd if=/dev/ubi0_1 of=/tmp/rfs1.ubi
dd: writing '/tmp/rfs1.ubi': No space left on device
124833+0 records in
124832+0 records out

da się zamontować pendrive w failsafe?

6

(16 odpowiedzi, napisanych Oprogramowanie / Software)

/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_1 on /overlay type ubifs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sdb2 on /mnt/sdb2 type ext4 (rw,relatime,data=ordered)
/dev/sdb3 on /mnt/sdb3 type ext4 (rw,relatime,data=ordered)

7

(16 odpowiedzi, napisanych Oprogramowanie / Software)

Nie wiem jaki mam system plików, netgar WNDR4300 ma pamięć flash typu NAND, to słowo jest w nazwie Twoich obrazów, jak również wyraz squashfs, co sugerowałoby taki system plików.

luci-17.01-snapshot-r3566-98c003e-ar71xx-nand-wndr4300-squashfs-sysupgrade.tar

Pełnego backupu nie udało mi się zrobić, skorzystałem z sysupgrade (przez gui lub z konsoli). Niestety trzeba doinstalować brakujące programy. Czyli bez rozkręcania routera nie da się pełnego backupu zrobić... .
Przy okazji, o co to znaczy gdy po starcie w logach pojawia się błąd:

Thu Dec 14 09:41:17 2017 kern.err kernel: [   26.368148] blk_update_request: I/O error, dev mtdblock4, sector 16
Thu Dec 14 09:41:17 2017 kern.err kernel: [   26.374522] Buffer I/O error on dev mtdblock4, logical block 2, async page read

Wgranie od nowa firmware nic nie zmienia, wynik polecenia grep "" /proc/mtd jest taki sam jak u założyciela tematu.

8

(16 odpowiedzi, napisanych Oprogramowanie / Software)

Także chciałem zrobić backup lede na WNDR4300, raz udało mi się wbić w failsafe przez ssh bez hasła, ale teraz chce hasło - jednak żadne nie wchodzi. Czy zgodnie z:

Tryb failsafe dotyczy tylko obrazów z systemem plików squashfs - dla innych (jffs2, ext4, ubifs) nie ma on zastosowania.

backup robimy podczas normalnej pracy routera?

9

(20 odpowiedzi, napisanych Oprogramowanie / Software)

O, faktycznie, dziękuję!
Do czasu gdy vpn nie działało, żeby zalogować od strony lan na modem adsl, po każdym wznowieniu połączenia pppoe, musiałem zrestartować firewall. Teraz nie mogę w ogóle zalogować się na modem. Adres modemu to: 192.168.254.254, adres routera: 192.168.123.1.
Konfigurując sugerowałem się http://openrouter.info/index.php?option … ;Itemid=61
W /etc/firewall.user mam:

ifconfig eth0.2 192.168.254.253
iptables -t nat -I postrouting_rule -p tcp --src 192.168.123.0/24 --dst 192.168.254.254 --dport 80 -j SNAT --to 192.168.254.253
iptables -I zone_lan_forward -p tcp --src 192.168.123.0/24 --dst 192.168.254.254 --dport 80 -j ACCEPT

Może dałoby się także podejrzeć co się modemem przez vpn?

10

(20 odpowiedzi, napisanych Oprogramowanie / Software)

Wygenerowałem certyfikaty od nowa, plik "dh2048.pem" pojawił się, klient łączy się z serwerem.
Mam jeszcze kilka pytań związanych z tematem. Klient na ubuntu łączy się z wszystkimi urządzeniami w sieci lokalnej oprócz jednego AP. Taki sam problem występował również w poprzednim routerze (tomato), łącząc się z nim przez openvpn. Będąc fizycznie z tym laptopem z ubuntu w sieci lokalnej nie ma problemu z zalogowaniem się na ten AP. Wydaje się że coś ubuntu ma gdzieś zapisane, tylko co i gdzie tego szukać?

11

(20 odpowiedzi, napisanych Oprogramowanie / Software)

Wygenerowałem certyfikaty zgodnie z poradnikiem: http://eko.one.pl/?p=openwrt-openvpntun.
Nie pojawił się dh2048.pem (plik z parametrami algorytmu Diffiego-Hellm?). Czy mam go sobie wygenerować poleceniem:

# openssl dhparam -out dh2048.pem 2048

12

(20 odpowiedzi, napisanych Oprogramowanie / Software)

A co właściwie powinno być zainstalowane gdy ma się zamiar korzystać z haseł współdzielonych:
openvpn-nossl czy openvpn-openssl ?

13

(20 odpowiedzi, napisanych Oprogramowanie / Software)

Korzystam, korzystam, jestem godny podziwu za wszystkie Twoje poradniki. Ale chyba jestem za mało kreatywny, inteligentny aby ogarnąć to wszystko i dostosować do moich potrzeb i oprogramowania. Póki co zmieniłem config serwera, ale nic to nie pomogło.
/etc/init.d/openvpn start

Wed Apr 13 09:48:02 2016 daemon.notice openvpn(my-vpn)[32384]: OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Jul 25 2015
Wed Apr 13 09:48:02 2016 daemon.notice openvpn(my-vpn)[32384]: library versions: OpenSSL 1.0.2e 3 Dec 2015, LZO 2.08
Wed Apr 13 09:48:02 2016 daemon.notice openvpn(my-vpn)[32384]: Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Apr 13 09:48:02 2016 daemon.notice openvpn(my-vpn)[32384]: Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Apr 13 09:48:02 2016 daemon.notice openvpn(my-vpn)[32384]: Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Apr 13 09:48:02 2016 daemon.notice openvpn(my-vpn)[32384]: Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Apr 13 09:48:03 2016 daemon.notice openvpn(my-vpn)[32384]: Socket Buffers: R=[163840->131072] S=[163840->131072]
Wed Apr 13 09:48:03 2016 daemon.notice netifd: Interface 'vpn' is enabled
Wed Apr 13 09:48:03 2016 daemon.notice netifd: Network device 'tun0' link is up
Wed Apr 13 09:48:03 2016 daemon.notice netifd: Interface 'vpn' has link connectivity 
Wed Apr 13 09:48:03 2016 daemon.notice netifd: Interface 'vpn' is setting up now
Wed Apr 13 09:48:03 2016 daemon.notice openvpn(my-vpn)[32384]: TUN/TAP device tun0 opened
Wed Apr 13 09:48:03 2016 daemon.notice openvpn(my-vpn)[32384]: TUN/TAP TX queue length set to 100
Wed Apr 13 09:48:03 2016 daemon.notice openvpn(my-vpn)[32384]: UDPv4 link local (bound): [undef]
Wed Apr 13 09:48:03 2016 daemon.notice openvpn(my-vpn)[32384]: UDPv4 link remote: [undef]
Wed Apr 13 09:48:03 2016 daemon.err openvpn(sample_server)[32383]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 09:48:03 2016 daemon.warn openvpn(sample_server)[32383]: Use --help for more information.
Wed Apr 13 09:48:03 2016 daemon.notice netifd: Interface 'vpn' is now up
Wed Apr 13 09:48:03 2016 user.notice firewall: Reloading firewall due to ifup of vpn (tun0)
Wed Apr 13 09:48:03 2016 user.notice root: starting ntpclient
Wed Apr 13 09:48:08 2016 daemon.err openvpn(sample_server)[32515]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 09:48:08 2016 daemon.warn openvpn(sample_server)[32515]: Use --help for more information.
Wed Apr 13 09:48:13 2016 daemon.err openvpn(sample_server)[32537]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 09:48:13 2016 daemon.warn openvpn(sample_server)[32537]: Use --help for more information.
Wed Apr 13 09:48:18 2016 daemon.err openvpn(sample_server)[32538]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 09:48:18 2016 daemon.warn openvpn(sample_server)[32538]: Use --help for more information.
Wed Apr 13 09:48:23 2016 daemon.err openvpn(sample_server)[32543]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 09:48:23 2016 daemon.warn openvpn(sample_server)[32543]: Use --help for more information.
Wed Apr 13 09:48:28 2016 daemon.err openvpn(sample_server)[32547]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 09:48:28 2016 daemon.warn openvpn(sample_server)[32547]: Use --help for more information.
Wed Apr 13 09:48:28 2016 daemon.info procd: Instance openvpn::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

cat /etc/config/openvpn

config openvpn 'sample_server'
    option enabled '1'
    option port '1194'
    option proto 'udp'
    option dev 'tun'
#    option ca '/etc/openvpn/ca.crt'
#    option cert '/etc/openvpn/server.crt'
#    option key '/etc/openvpn/secret.key'
    option dh '/etc/openvpn/dh1024.pem'
    option server '10.8.0.0 255.255.255.0'
#    option ifconfig_pool_persist '/tmp/ipp.txt'
    option keepalive '10 120'
#    option comp_lzo 'yes'
#    option persist_key '1'
    option persist 'key'
#    option persist_tun '1'
#    option user 'nobody'
    option status '/tmp/openvpn.log'
    option verb '3'
    option secret '/etc/openvpn/secret.key'

14

(20 odpowiedzi, napisanych Oprogramowanie / Software)

Dziękuję za pomoc. Postęp nastąpił - pojawia się informacja w logu serwera gdy klient próbuje się połączyć, ale jeszcze nie działa tak jak powinno. Teraz wygląda to tak.
/etc/init.d/openvpn start

Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Jul 25 2015
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: library versions: OpenSSL 1.0.2e 3 Dec 2015, LZO 2.08
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: Socket Buffers: R=[163840->131072] S=[163840->131072]
Wed Apr 13 08:38:10 2016 daemon.notice netifd: Interface 'vpn' is enabled
Wed Apr 13 08:38:10 2016 daemon.notice netifd: Network device 'tun0' link is up
Wed Apr 13 08:38:10 2016 daemon.notice netifd: Interface 'vpn' has link connectivity 
Wed Apr 13 08:38:10 2016 daemon.notice netifd: Interface 'vpn' is setting up now
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: TUN/TAP device tun0 opened
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: TUN/TAP TX queue length set to 100
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: UDPv4 link local (bound): [undef]
Wed Apr 13 08:38:10 2016 daemon.notice openvpn(my-vpn)[28593]: UDPv4 link remote: [undef]
Wed Apr 13 08:38:10 2016 daemon.err openvpn(sample_server)[28592]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 08:38:10 2016 daemon.warn openvpn(sample_server)[28592]: Use --help for more information.
Wed Apr 13 08:38:10 2016 daemon.notice netifd: Interface 'vpn' is now up
Wed Apr 13 08:38:10 2016 user.notice firewall: Reloading firewall due to ifup of vpn (tun0)
Wed Apr 13 08:38:11 2016 user.notice root: starting ntpclient
Wed Apr 13 08:38:15 2016 daemon.err openvpn(sample_server)[28735]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 08:38:15 2016 daemon.warn openvpn(sample_server)[28735]: Use --help for more information.
Wed Apr 13 08:38:20 2016 daemon.err openvpn(sample_server)[28736]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 08:38:20 2016 daemon.warn openvpn(sample_server)[28736]: Use --help for more information.
Wed Apr 13 08:38:25 2016 daemon.err openvpn(sample_server)[28741]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 08:38:25 2016 daemon.warn openvpn(sample_server)[28741]: Use --help for more information.
Wed Apr 13 08:38:30 2016 daemon.err openvpn(sample_server)[28742]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 08:38:30 2016 daemon.warn openvpn(sample_server)[28742]: Use --help for more information.
Wed Apr 13 08:38:35 2016 daemon.err openvpn(sample_server)[28743]: Options error: --server and --secret cannot be used together (you must use SSL/TLS keys)
Wed Apr 13 08:38:35 2016 daemon.warn openvpn(sample_server)[28743]: Use --help for more information.
Wed Apr 13 08:38:35 2016 daemon.info procd: Instance openvpn::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

przy próbie łączenia kilenta na serwerze pojawia się:

Wed Apr 13 08:49:01 2016 daemon.notice openvpn(my-vpn)[28593]: Peer Connection Initiated with [AF_INET]5.172.247.233:16950
Wed Apr 13 08:49:01 2016 daemon.notice openvpn(my-vpn)[28593]: Initialization Sequence Completed
Wed Apr 13 08:49:01 2016 daemon.err openvpn(my-vpn)[28593]: write to TUN/TAP : Invalid argument (code=22)
Wed Apr 13 08:49:01 2016 daemon.err openvpn(my-vpn)[28593]: write to TUN/TAP : Invalid argument (code=22)
Wed Apr 13 08:49:01 2016 daemon.err openvpn(my-vpn)[28593]: write to TUN/TAP : Invalid argument (code=22)

cat /etc/config/openvpn

config openvpn 'sample_server'
        option enabled '1'
        option server '1'
        option port '1194'
        option proto 'udp'
#       option dev 'tun0'
#       option ca '/etc/openvpn/ca.crt'
#       option cert '/etc/openvpn/server.crt'
#       option key '/etc/openvpn/secret.key'
#       option dh '/etc/openvpn/dh1024.pem'
        option server '10.8.0.0 255.255.255.0'
#       option ifconfig_pool_persist '/tmp/ipp.txt'
        option keepalive '10 120'
#       option comp_lzo 'yes'
        option persist_key '1'
#       option persist 'key'
        option persist_tun '1'
#       option user 'nobody'
        option status '/tmp/openvpn.log'
        option verb '3'
        option secret '/etc/openvpn/secret.key'

cat /tmp/openvpn.log

OpenVPN STATISTICS
Updated,Wed Apr 13 09:07:15 2016
TUN/TAP read bytes,0
TUN/TAP write bytes,0
TCP/UDP read bytes,65192
TCP/UDP write bytes,0
Auth read bytes,50277
END

klient ubuntu: /etc/openvpn/openvpn.log

Wed Apr 13 08:49:42 2016 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Dec  1 2014
Wed Apr 13 08:49:42 2016 WARNING: you are using user/group/chroot/setcon without persist-tun -- this may cause restarts to fail
Wed Apr 13 08:49:42 2016 WARNING: file '/etc/openvpn/1.key' is group or others accessible
Wed Apr 13 08:49:42 2016 TUN/TAP device tun0 opened
Wed Apr 13 08:49:42 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Wed Apr 13 08:49:42 2016 /sbin/ip link set dev tun0 up mtu 1500
Wed Apr 13 08:49:42 2016 /sbin/ip addr add dev tun0 local 10.8.0.2 peer 10.8.0.1
Wed Apr 13 08:49:43 2016 GID set to nogroup
Wed Apr 13 08:49:43 2016 UID set to nobody
Wed Apr 13 08:49:43 2016 UDPv4 link local: [undef]
Wed Apr 13 08:49:43 2016 UDPv4 link remote: [AF_INET]178.183.228.132:1194
RTNETLINK answers: Operation not permitted
Wed Apr 13 08:50:35 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
RTNETLINK answers: Operation not permitted
Wed Apr 13 08:50:35 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
RTNETLINK answers: Operation not permitted
Wed Apr 13 08:50:35 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
RTNETLINK answers: Operation not permitted
Wed Apr 13 08:50:35 2016 ERROR: Linux route add command failed: external program exited with error status: 2
Wed Apr 13 08:50:35 2016 /sbin/ip addr del dev tun0 local 10.8.0.2 peer 10.8.0.1
RTNETLINK answers: Operation not permitted
Wed Apr 13 08:50:35 2016 Linux ip addr del failed: external program exited with error status: 2
Wed Apr 13 08:50:35 2016 SIGTERM[hard,] received, process exiting

cat /etc/openvpn/client.conf

remote kiton.homenet.org 1194
dev tun
comp-lzo adaptive
keepalive 15 60
ifconfig 10.8.0.2 10.8.0.1
secret /etc/openvpn/1.key
route 192.168.1.0 255.255.255.0
persist-key
nobind
redirect-gateway
dhcp-option DNS 192.168.123.1
user nobody
group nogroup
log openvpn.log
status openvpn-status.log

15

(20 odpowiedzi, napisanych Oprogramowanie / Software)

klient jest na ubuntu: cat /etc/openvpn/openvpn.log

Tue Apr 12 11:12:09 2016 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Dec  1 2014
Tue Apr 12 11:12:09 2016 WARNING: file '/etc/openvpn/1.key' is group or others accessible
Tue Apr 12 11:12:09 2016 TUN/TAP device tun0 opened
Tue Apr 12 11:12:09 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Apr 12 11:12:09 2016 /sbin/ip link set dev tun0 up mtu 1500
Tue Apr 12 11:12:09 2016 /sbin/ip addr add dev tun0 local 10.8.0.2 peer 10.8.0.1
Tue Apr 12 11:12:09 2016 GID set to nogroup
Tue Apr 12 11:12:09 2016 UID set to nobody
Tue Apr 12 11:12:09 2016 Attempting to establish TCP connection with [AF_INET]178.183.231.126:1194 [nonblock]
Tue Apr 12 11:12:10 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:12:35 2016 RESOLVE: Cannot resolve host address: in.myftp.org: Temporary failure in name resolution
Tue Apr 12 11:12:36 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:13:01 2016 RESOLVE: Cannot resolve host address: in.myftp.org: Temporary failure in name resolution
Tue Apr 12 11:13:02 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:13:17 2016 RESOLVE: Cannot resolve host address: in.myftp.org: Temporary failure in name resolution
Tue Apr 12 11:13:27 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection timed out
Tue Apr 12 11:13:33 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:13:40 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:13:46 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:13:52 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused
Tue Apr 12 11:13:59 2016 TCP: connect to [AF_INET]178.183.231.126:1194 failed, will try again in 5 seconds: Connection refused

cat /etc/openvpn/client.conf

remote kiton.homenet.org
dev tun
proto tcp-client
comp-lzo adaptive
keepalive 15 60
ifconfig 10.8.0.2 10.8.0.1
secret /etc/openvpn/1.key
route 192.168.1.0 255.255.255.0
persist-key
persist-tun
nobind
redirect-gateway
dhcp-option DNS 192.168.123.1
user nobody
group nogroup
log openvpn.log
status openvpn-status.log

16

(20 odpowiedzi, napisanych Oprogramowanie / Software)

Przez internet tak, tylko nie przez vpn. Np. subdomena http://kiton.homenet.org/ dzała (i nawet lighttpd dzała :-)

17

(20 odpowiedzi, napisanych Oprogramowanie / Software)

adsl t-mobile po drutach orange, ddns skonfigurowany prawidłowo, na router przez internet loguję się bez problemu.

18

(20 odpowiedzi, napisanych Oprogramowanie / Software)

Chciałbym posiadać działający serwer openvpn TUN z kluczem statycznym na openwrt 15.05 chaos calmer. Kombinuję na różne sposoby, niestety coś jest nie tak, klient nie łączy się z serwerem, podczas prób łączenia w logu systemowym serwera nie pojawiają się żadne wpisy.

cat /tmp/openvpn.log

OpenVPN STATISTICS
Updated,Tue Apr 12 11:46:58 2016
TUN/TAP read bytes,0
TUN/TAP write bytes,0
TCP/UDP read bytes,0
TCP/UDP write bytes,0
Auth read bytes,0
END

cat /etc/config/network

config interface 'vpn'      
        option ifname 'tun0'
        option proto 'none' 

cat /etc/config/firewall

config zone                               
        option name 'vpn'      
        option input 'ACCEPT'     
        option forward 'ACCEPT'       
        option output 'ACCEPT'       
        option network 'vpn'      
                                                
config forwarding                      
        option src 'vpn'              
        option dest 'wan'          
                                            
config rule                      
        option name 'OpenVPN'      
        option target 'ACCEPT'        
        option dest_port '1194'
        option proto 'udp'    
        option src 'wan'

cat /etc/config/openvpn

config openvpn 'myvpn'
        option config '/etc/openvpn/my-vpn.conf'
        option enable '1'
        option log '/tmp/openvpn.log'
        option server '10.8.0.0 255.255.255.0'

cat /etc/openvpn/my-vpn.conf

port 1194
proto udp
dev tun0
#keepalive 10 120
status /tmp/openvpn.log
verb 3
secret /etc/openvpn/secret.key

cat /etc/openvpn/secret.key

#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
...
-----END OpenVPN Static key V1-----

/etc/init.d/openvpn start

Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Jul 25 2015
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: library versions: OpenSSL 1.0.2e 3 Dec 2015, LZO 2.08
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: Socket Buffers: R=[163840->131072] S=[163840->131072]
Tue Apr 12 12:32:16 2016 daemon.notice netifd: Interface 'vpn' is enabled
Tue Apr 12 12:32:16 2016 daemon.notice netifd: Network device 'tun0' link is up
Tue Apr 12 12:32:16 2016 daemon.notice netifd: Interface 'vpn' has link connectivity 
Tue Apr 12 12:32:16 2016 daemon.notice netifd: Interface 'vpn' is setting up now
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: TUN/TAP device tun0 opened
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: TUN/TAP TX queue length set to 100
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: UDPv4 link local (bound): [undef]
Tue Apr 12 12:32:16 2016 daemon.notice openvpn(myvpn)[19840]: UDPv4 link remote: [undef]
Tue Apr 12 12:32:16 2016 daemon.notice netifd: Interface 'vpn' is now up
Tue Apr 12 12:32:17 2016 user.notice firewall: Reloading firewall due to ifup of vpn (tun0)
Tue Apr 12 12:32:17 2016 user.notice root: starting ntpclient

19

(4 odpowiedzi, napisanych Oprogramowanie / Software)

# opkg install mc
Installing mc (4.8.14-1.3) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/packages/mc_4.8.14-1.3_ar71xx.ipk.
Configuring mc.

Edytorem jest vi i nie da się, nie wiem jak to zmienić.

W związku z zainstalowaniem nowszego systemu pojawiły się nowe pytania:
1. W którym miejscu można zmienić port logowania na stronę konfiguracyjną routera?
2. Co zrobić żeby móc korzystać wbudowanego edytora mc, zamiast vi?
Dziękuję.

21

(8 odpowiedzi, napisanych Oprogramowanie / Software)

Udało mi się znaleźć sposób powiązania strony ze skryptem cgi. Tuż za tagiem <body> wstawiłem <script src="/cgi-bin/test.cgi"></script>
Po umieszczeniu go tuż przed tagiem zamykającym </body> obrazki odświeżane są po wyświetleniu strony. Dziękuję za pomoc.

22

(8 odpowiedzi, napisanych Oprogramowanie / Software)

A sam skrypt się czymś się wtedy różni? Mógłbyś podpowiedzieć co zrobić żeby wywołując plik z rozszerzeniem html wyświetlała się strona z odświeżonymi obrazkami? Czy lepiej będzie zapisywać te obrazki w ram niż usb?

23

(8 odpowiedzi, napisanych Oprogramowanie / Software)

W lighttpd zmieniłem:

cgi.assign = ( ".pl"  => "/usr/bin/perl", ".cgi" => "" )

W katalogu /www/cgi-bin utworzyłem plik test.cgi o zawartości:

#!/bin/sh
echo "Content-type: text/html"
echo ''

(w tym miejscu są skrypty tworzące obrazki)

cat << _EOF_
<html>
<head>
<meta http-equiv="refresh" content="0; url=/router.html">
</head>
<body></body>
</html>

Gdy wpiszę adres routera/cgi-bin/test.cgi wyświetla się strona z odświeżonymi obrazkami. Prawidłowo chyba należałoby wpisać adres z rozszerzeniem html?
W tym momencie załadowany mam moduł CGI. Czy nie można by zrezygnować z CGI na rzecz FastCGI - czytałem że ten lepiej się sprawdza?

24

(8 odpowiedzi, napisanych Oprogramowanie / Software)

Skytpty CGI próbują zapisywać mi się na dysku. Może problemem jest to że zainstalowane mam CGI i FastCGI.

# opkg list_installed
badblocks - 1.42.4-1
base-files - 118.2-r42647
bc - 1.06.95-1
blkid - 2.21.2-1
block-mount - 0.2.0-9cj
bridge - 1.5-1
busybox - 1.19.4-6
bwmon-gargoyle - 1.6.2.2-1
chat - 2.4.5-10
collectd - 4.10.7-2
collectd-mod-conntrack - 4.10.7-2
collectd-mod-cpu - 4.10.7-2
collectd-mod-interface - 4.10.7-2
collectd-mod-memory - 4.10.7-2
collectd-mod-ping - 4.10.7-2
collectd-mod-rrdtool - 4.10.7-2
comgt - 0.32-21cj1
ddns-gargoyle - 1.6.2.2-1
disktype - 9-2
dnsmasq - 2.66-2
dosfsck - 3.0.9-1
dropbear - 2014.65-1
e2fsprogs - 1.42.4-1
ebtables - 2.0.10-4-1
ewget - 1.6.2.2-1
fdisk - 2.21.2-1
firewall - 2013-06-29
fuse-utils - 2.9.0-2
gargoyle - 1.6.2.2-6
gargoyle-firewall-util - 1.6.2.2-1
gargoyle-i18n - 0.2.1-1
glib2 - 2.34.3-1
gpkg - 1.6.2.2-1
haserl-i18n - 0.9.26-1
hotplug2 - 1.0-beta-4
httpd-gargoyle - 1.6.2.2-1
ip - 3.3.0-2
ipset - 6.11-2
iptables - 1.4.10-5
iptables-mod-bandwidth - 1.4.10-5
iptables-mod-conntrack-extra - 1.4.10-5
iptables-mod-extra - 1.4.10-5
iptables-mod-filter - 1.4.10-5
iptables-mod-imq - 1.4.10-5
iptables-mod-ipopt - 1.4.10-5
iptables-mod-iprange - 1.4.10-5
iptables-mod-ipset - 1.4.10-5
iptables-mod-nat-extra - 1.4.10-5
iptables-mod-timerange - 1.4.10-5
iptables-mod-webmon - 1.4.10-5
iptables-mod-weburl - 1.4.10-5
iw - 3.14-1
jshn - 2013-10-19-734d28eb1a46358743cf8837c91e5d46695c3b91
kernel - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ath - 3.3.8+2014-05-22-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ath9k - 3.3.8+2014-05-22-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ath9k-common - 3.3.8+2014-05-22-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-cfg80211 - 3.3.8+2014-05-22-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-crypto-aes - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-crypto-arc4 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-crypto-core - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ebtables - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-exportfs - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-ext4 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-hfsplus - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-msdos - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-nfs - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-nfs-common - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-nfsd - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fs-vfat - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-fuse - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-gpio-button-hotplug - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-gre - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-bandwidth - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-conntrack - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-conntrack-extra - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-core - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-extra - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-filter - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-imq - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-ipopt - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-iprange - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-ipset - 3.3.8+6.11-2-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-nat - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-nat-extra - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-nathelper - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-nathelper-extra - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-timerange - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-webmon - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipt-weburl - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ipv6 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-leds-gpio - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ledtrig-default-on - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ledtrig-netdev - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ledtrig-timer - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ledtrig-usbdev - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-lib-crc-ccitt - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-lib-crc16 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-lib-textsearch - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-mac80211 - 3.3.8+2014-05-22-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nfnetlink - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-base - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp1250 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp1251 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp437 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp775 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp850 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp852 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-cp866 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-iso8859-1 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-iso8859-13 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-iso8859-15 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-iso8859-2 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-koi8r - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-nls-utf8 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-ppp - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-pppoe - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-pppox - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-pptp - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-sched - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-sched-core - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-scsi-core - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-tun - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-acm - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-core - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-net - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-net-cdc-ether - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-net-cdc-ncm - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-net-qmi-wwan - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-net-rndis - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-printer - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-serial - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-serial-ftdi - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-serial-option - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-serial-qualcomm - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-serial-sierrawireless - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-serial-wwan - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-sierrawireless-directip - 3.3.8-10-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-storage - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-storage-extras - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb-wdm - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-usb2 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
kmod-wdt-ath79 - 3.3.8-1-3b70fc7d412617eb97c6bdc7d8fb7844
libart - 2.3.21-1
libbbtargz - 1.6.2.2-1
libblkid - 2.21.2-1
libblobmsg-json - 2013-10-19-734d28eb1a46358743cf8837c91e5d46695c3b91
libbz2 - 1.0.6-1
libc - 0.9.33.2-1
libcom_err - 1.42.4-1
libcyassl - 1.6.5-1
libericstools - 1.6.2.2-1
libevent - 1.4.14b-2
libext2fs - 1.42.4-1
libffi - 3.0.11-1
libfreetype - 2.4.8-1
libfuse - 2.9.0-2
libgcc - 4.6-linaro-1
libip4tc - 1.4.10-5
libip6tc - 1.4.10-5
libiptbwctl - 1.6.2.2-1
libjson-c - 0.11-2
libltdl - 2.4-1
liblzo - 2.04-1
libmnl - 1.0.1-1
libncurses - 5.7-5
libnet0 - 1.0.2a-8
libnfnetlink - 1.0.0-2
libnids - 1.18-1
libnl-tiny - 0.1-3
libopenssl - 1.0.1h-1
liboping - 1.6.2-1
libow - 2.8p13-1
libpcap - 1.1.1-2
libpcre - 8.11-2
libpcsclite - 1.8.2-1
libpng - 1.2.46-2
libpthread - 0.9.33.2-1
libreadline - 5.2-2
librpc - 0.9.32-rc2-0a2179bbc0844928f2a0ec01dba93d9b5d6d41a7
librrd - 1.2.30-3
librrd1 - 1.0.50-2
librt - 0.9.33.2-1
libubox - 2013-10-19-734d28eb1a46358743cf8837c91e5d46695c3b91
libubus - 2013-08-08-b20a8a01c7faea5bcc9d34d10dcf7736589021b8
libuci - 2013-06-11.1-1
libusb - 0.1.12-3
libusb-1.0 - 1.0.9-1
libuuid - 2.21.2-1
libwrap - 7.6-1
libxml2 - 2.7.8-2
libxtables - 1.4.10-5
lighttpd - 1.4.30-2
lighttpd-mod-cgi - 1.4.30-2
lighttpd-mod-fastcgi - 1.4.30-2
mc - 4.7.5.3-2
miniupnpd - 1.8.20130426-2
mtd - 18.1
netifd - 2013-07-16-2674941b06c1ec67f1aff1bff9212e1372106641
nfs-kernel-server - 1.2.6-1
nfs-kernel-server-utils - 1.2.6-1
nfs-utils - 1.2.6-1
ntfs-3g - 2011.4.12-1-fuseext
openssl-util - 1.0.1h-1
openvpn - 2.2.2-2
openvpn-easy-rsa - 2.2.2-2
oscam - 9986-1
owfs - 2.8p13-1
p910nd - 0.95-1
php5 - 5.4.5-3
php5-cgi - 5.4.5-3
php5-fastcgi - 5.4.5-3
plugin-gargoyle-i18n-English-EN - 1.0.0-1
plugin-gargoyle-i18n-Polish-PL - 1.0.0-1
plugin-gargoyle-initd - 20130903
plugin-gargoyle-logread - 20120724-4
plugin-gargoyle-openvpn - 1.6.2.2-1
plugin-gargoyle-ping-watchdog - 20131030
plugin-gargoyle-usb-printer - 1.6.2.2-1
plugin-gargoyle-usb-storage - 1.6.2.2-1
plugin-gargoyle-wifi-schedule - 1.1.2-2
portmap - 6.0-3
ppp - 2.4.5-10
ppp-mod-pppoe - 2.4.5-10
qos-gargoyle - 1.6.2.2-1
rrdtool - 1.2.30-3
samba36-server - 3.6.5-3
share-users - 1.6.2.2-1
swap-utils - 2.21.2-1
swconfig - 10
tc - 3.3.0-2
terminfo - 5.7-5
ubus - 2013-08-08-b20a8a01c7faea5bcc9d34d10dcf7736589021b8
ubusd - 2013-08-08-b20a8a01c7faea5bcc9d34d10dcf7736589021b8
uci - 2013-06-11.1-1
uqmi - 2013-06-23-35201737484008ac802649cbe9fb5f7ab38a4ad2
urlsnarf - 2.4b1-2
usb-modeswitch - 2.2.0-1
usb-modeswitch-data - 20140529-1
vsftpd - 3.0.2-2
webmon-gargoyle - 1.6.2.2-1
wireless-tools - 29-5
wol - 0.7.1-2
wpad-mini - 20131120-1
zip - 2.32-1
zlib - 1.2.7-1

Czy użycie tylko fastCGI będzie dobrym rozwązaniem?

# lighttpd configuration file
# 
## modules to load
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules = ( 
#    "mod_rewrite", 
#    "mod_redirect", 
#    "mod_alias", 
#    "mod_auth", 
#    "mod_status", 
#    "mod_setenv",
    "mod_fastcgi",
#    "mod_proxy",
#    "mod_simple_vhost",
    "mod_cgi",
#    "mod_ssi",
#    "mod_usertrack",
#    "mod_expire",
#    "mod_webdav"
)

# force use of the "write" backend (closes: #2401)
server.network-backend = "write"

## a static document-root, for virtual-hosting take look at the 
## server.virtual-* options
server.document-root = "/tmp/usb_mount/dev_sda2/www/"
#server.document-root = "/tmp/"

## where to send error-messages to
server.errorlog = "/var/log/lighttpd/error.log"

## files to check for if .../ is requested
index-file.names = ( "index.php", "index.html", "default.html", "index.htm", "default.htm" )

## mimetype mapping
mimetype.assign = (  
    ".pdf"   => "application/pdf",
    ".class" => "application/octet-stream",
    ".pac"   => "application/x-ns-proxy-autoconfig",
    ".swf"   => "application/x-shockwave-flash",
    ".wav"   => "audio/x-wav",
    ".gif"   => "image/gif",
    ".jpg"   => "image/jpeg",
    ".jpeg"  => "image/jpeg",
    ".png"   => "image/png",
    ".svg"   => "image/svg+xml",
    ".css"   => "text/css",
    ".html"  => "text/html",
    ".htm"   => "text/html",
    ".js"    => "text/javascript",
    ".txt"   => "text/plain",
    ".dtd"   => "text/xml",
    ".xml"   => "text/xml"
 )

## Use the "Content-Type" extended attribute to obtain mime type if possible
#mimetypes.use-xattr = "enable"

## send a different Server: header
## be nice and keep it at lighttpd
#server.tag = "lighttpd"

$HTTP["url"] =~ "\.pdf$" {
    server.range-requests = "disable"
}

##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

######### Options that are good to be but not neccesary to be changed #######

## bind to port (default: 80)
#server.port = 81

## bind to localhost (default: all interfaces)
#server.bind = "localhost"

## error-handler for status 404
#server.error-handler-404 = "/error-handler.html"
#server.error-handler-404 = "/error-handler.php"

## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"


###### virtual hosts
##
##   If you want name-based virtual hosting add the next three settings and load
##   mod_simple_vhost
##
## document-root =
##   virtual-server-root + virtual-server-default-host + virtual-server-docroot or
##   virtual-server-root + http-host + virtual-server-docroot
##
#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
#simple-vhost.default-host = "grisu.home.kneschke.de"
#simple-vhost.document-root = "/pages/"


## 
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/www/error-"

## virtual directory listings
#server.dir-listing = "enable"

## send unhandled HTTP-header headers to error-log
#debug.dump-unknown-headers = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"

## change uid to <uid> (default: don't care)
#server.username = "nobody"
#
server.upload-dirs = ( "/tmp" )

## change uid to <uid> (default: don't care)
#server.groupname = "nobody"

#### compress module
#compress.cache-dir          = "/dev/null/"
#compress.filetype           = ("text/plain", "text/html")

#### proxy module
## read proxy.txt for more info
#proxy.server = (
#    ".php" => (
#        "localhost" => (
#            "host" => "192.168.0.101",
#            "port" => 80
#        )
#    )
#)

#### fastcgi module
## read fastcgi.txt for more info
fastcgi.server = (
    ".php" => ((
    "host" => "127.0.0.1",
    "port" => 1026,
    ))
)

#### CGI module
#cgi.assign = ( ".pl"  => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
cgi.assign = ( ".php" => "/usr/bin/php-cgi" )
#cgi.assign = ( ".php" => "/tmp/usb_mount/dev_sda2/www/cgi-bin" )

#### SSL engine
#ssl.engine = "enable"
#ssl.pemfile = "server.pem"

#### status module
#status.status-url = "/server-status"
#status.config-url = "/server-config"

#### auth module
## read authentification.txt for more info
#auth.backend = "plain"
#auth.backend.plain.userfile = "lighttpd.user"
#auth.backend.plain.groupfile = "lighttpd.group"
#auth.require = (
#    "/server-status" => ( 
#        "method"  => "digest",
#        "realm"   => "download archiv",
#        "require" => "group=www|user=jan|host=192.168.2.10"
#    ),
#    "/server-info" => ( 
#        "method"  => "digest",
#        "realm"   => "download archiv",
#        "require" => "group=www|user=jan|host=192.168.2.10"
#    )
#)

#### url handling modules (rewrite, redirect, access)
#url.rewrite = ( "^/$" => "/server-status" )
#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )

#### both rewrite/redirect support back reference to regex conditional using %n
#$HTTP["host"] =~ "^www\.(.*)" {
#    url.redirect = ( "^/(.*)" => "http://%1/$1" )
#}

#### expire module
#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")

#### ssi
#ssi.extension = ( ".shtml" )

#### setenv
#setenv.add-request-header  = ( "TRAV_ENV" => "mysql://user@host/db" )
#setenv.add-response-header = ( "X-Secret-Message" => "42" )

#### variable usage:
## variable name without "." is auto prefixed by "var." and becomes "var.bar"
#bar = 1
#var.mystring = "foo"

## integer add
#bar += 1
## string concat, with integer cast as string, result: "www.foo1.com"
#server.name = "www." + mystring + var.bar + ".com"
## array merge
#index-file.names = (foo + ".php") + index-file.names
#index-file.names += (foo + ".php")

#### include
#include /etc/lighttpd/lighttpd-inc.conf
## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
#include "lighttpd-inc.conf"

#### include_shell
#include_shell "echo var.a=1"
## the above is same as:
#var.a=1

#### webdav
#$HTTP["url"] =~ "^/webdav($|/)" {
# webdav.activate = "enable"
# webdav.is-readonly = "enable"
# webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db"
#}

25

(8 odpowiedzi, napisanych Oprogramowanie / Software)

Dzięki tutorialowi Cezrego udało mi się uruchomić collectd. Obrazki z wykresami generują się na stronce wywoływane skryptem dodanym do corn, co oczywiście w regularnych odstępach czasu obciąża router. Chciałbym aby generowały się w momencie otwierania strony, w związku z tym prosiłbym o przykładowy skrypt cgi, lub objaśnienie jak takowy napisać i jak to wszystko z sobą połączyć. Używam lighttpd, w katalogu głównym serwera znajduje się strona html, katalog z obrazkami i pusty sad katalog cgi-bin. Z góry dziękuję za pomoc.