PDA

Bekijk de volledige versie : http server not working



acko
07-05-2006, 17:54
Hi guys

Pls help me, I remove my usb stick and then restart router and connect usb stick back. My problem is that my httpd web service not working after that. I must install it and configure it again. What can be problem plss.

Thx for your answers

TheEagle
07-05-2006, 20:31
What happens if you just remove the stick and put it back in? Does httpd still work? Maybe you are saving it's configuration on the RAMFS, and after the reboot it's gone. Just an idea, can be anything else. If you can post the startup script for your httpd, maybe we can see where the problem comes from.

acko
10-05-2006, 18:02
I install php-thttpd and then try top, service S80thttpd was running and http://192.168.1.1:81 works too, after that i reboot my router and service was not running only service httpd was running. Works only /opt/etc/init.d/S80thttpd start, but after reboot not working

thttpd.conf



dir=/tmp/harddisk/share/www
port=81
user=nobody
nochroot
nosymlink
novhost
logfile=/opt/var/log/thttpd.log
pidfile=/opt/var/run/thttpd.pid


post-firewall



#!/bin/sh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 80 -j DNAT --to-destination $4:81


post-boot



#!/bin/sh
# wait for /opt to mount
mount /dev/discs/disc0/part2 /opt
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

# Activate swap
swapon /dev/discs/disc0/part3

# Run all active services - active means starts with S
/opt/etc/init.d/rc.unslung

acko
10-05-2006, 18:06
and ...

System Log



Jan 1 01:00:05 kernel: N_HDLC line discipline registered.
Jan 1 01:00:05 kernel: loop: loaded (max 8 devices)
Jan 1 01:00:05 kernel: PPP generic driver version 2.4.2
Jan 1 01:00:05 kernel: PPP Deflate Compression module registered
Jan 1 01:00:05 kernel: PPP BSD Compression module registered
Jan 1 01:00:05 kernel: MPPE/MPPC encryption/compression module registered
Jan 1 01:00:05 kernel: Amd/Fujitsu Extended Query Table v1.1 at 0x0040
Jan 1 01:00:05 kernel: number of CFI chips: 1
Jan 1 01:00:05 kernel: Flash device: 0x400000 at 0x1c000000
Jan 1 01:00:05 kernel: Physically mapped flash: squashfs filesystem found at block 944
Jan 1 01:00:05 kernel: Creating 5 MTD partitions on "Physically mapped flash":
Jan 1 01:00:05 kernel: 0x00000000-0x00040000 : "pmon"
Jan 1 01:00:05 kernel: 0x00040000-0x003e0000 : "linux"
Jan 1 01:00:05 kernel: 0x000ec04c-0x003e0000 : "rootfs"
Jan 1 01:00:05 kernel: 0x003f0000-0x00400000 : "nvram"
Jan 1 01:00:05 kernel: 0x003e0000-0x003f0000 : "config"
Jan 1 01:00:05 kernel: sflash: found no supported devices
Jan 1 01:00:05 kernel: NET4: Linux TCP/IP 1.0 for NET4.0
Jan 1 01:00:05 kernel: IP Protocols: ICMP, UDP, TCP
Jan 1 01:00:05 kernel: IP: routing cache hash table of 512 buckets, 4Kbytes
Jan 1 01:00:05 kernel: TCP: Hash tables configured (established 2048 bind 4096)
Jan 1 01:00:05 kernel: ip_conntrack version 2.1 (256 buckets, 2048 max) - 344 bytes per conntrack
Jan 1 01:00:05 kernel: ip_conntrack_pptp version 1.9 loaded
Jan 1 01:00:05 kernel: ip_nat_pptp version 1.5 loaded
Jan 1 01:00:05 kernel: ip_tables: (C) 2000-2002 Netfilter core team
Jan 1 01:00:05 kernel: ipt_time loading
Jan 1 01:00:05 kernel: NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Jan 1 01:00:05 kernel: IPv6 v0.8 for NET4.0
Jan 1 01:00:05 kernel: IPv6 over IPv4 tunneling driver
Jan 1 01:00:05 kernel: NET4: Ethernet Bridge 008 for NET4.0
Jan 1 01:00:05 kernel: 802.1Q VLAN Support v1.7 Ben Greear <greearb@candelatech.com>
Jan 1 01:00:05 kernel: All bugs added by David S. Miller <davem@redhat.com>
Jan 1 01:00:05 kernel: FAT: bogus logical sector size 22528
Jan 1 01:00:05 kernel: FAT: bogus logical sector size 22528
Jan 1 01:00:05 kernel: NTFS: Unable to set blocksize 512.
Jan 1 01:00:05 kernel: VFS: Mounted root (squashfs filesystem) readonly.
Jan 1 01:00:05 kernel: Mounted devfs on /dev
Jan 1 01:00:05 kernel: Freeing unused kernel memory: 72k freed
Jan 1 01:00:05 kernel: Algorithmics/MIPS FPU Emulator v1.5
Jan 1 01:00:05 kernel: 90.7.0
Jan 1 01:00:05 kernel: PCI: Enabling device 01:03.0 (0004 -> 0006)
Jan 1 01:00:05 kernel: eth1: Broadcom BCM4320 802.11 Wireless Controller 3.90.23.0
Jan 1 01:00:05 kernel: vlan0: add 33:33:00:00:00:01 mcast address to master interface
Jan 1 01:00:05 kernel: vlan0: add 33:33:ff:24:f4:5a mcast address to master interface
Jan 1 01:00:05 kernel: vlan0: dev_set_promiscuity(master, 1)
Jan 1 01:00:05 kernel: device eth0 entered promiscuous mode
Jan 1 01:00:05 kernel: device vlan0 entered promiscuous mode
Jan 1 01:00:05 kernel: device eth1 entered promiscuous mode
Jan 1 01:00:05 kernel: br0: port 2(eth1) entering listening state
Jan 1 01:00:05 kernel: br0: port 1(vlan0) entering listening state
Jan 1 01:00:05 kernel: br0: port 2(eth1) entering learning state
Jan 1 01:00:05 kernel: br0: port 1(vlan0) entering learning state
Jan 1 01:00:05 kernel: br0: port 2(eth1) entering forwarding state
Jan 1 01:00:05 kernel: br0: topology change detected, propagating
Jan 1 01:00:05 kernel: br0: port 1(vlan0) entering forwarding state
Jan 1 01:00:05 kernel: br0: topology change detected, propagating
Jan 1 01:00:05 dnsmasq[74]: started, version 2.22 cachesize 150
Jan 1 01:00:05 dnsmasq[74]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 24h
Jan 1 01:00:05 dnsmasq[74]: DHCP, /tmp/dnsmasq.log will be written every 8h
Jan 1 01:00:05 dnsmasq[74]: read /etc/hosts - 5 addresses
Jan 1 01:00:05 dnsmasq[74]: reading /tmp/resolv.conf
Jan 1 01:00:06 kernel: usb.c: registered new driver usbdevfs
Jan 1 01:00:06 kernel: usb.c: registered new driver hub
Jan 1 01:00:06 kernel: usb-uhci.c: $Revision: 1.275 $ time 21:43:09 Apr 20 2005
Jan 1 01:00:06 kernel: usb-uhci.c: High bandwidth mode enabled
Jan 1 01:00:06 kernel: PCI: Enabling device 01:02.0 (0000 -> 0001)
Jan 1 01:00:06 kernel: usb-uhci.c: USB UHCI at I/O 0x100, IRQ 2
Jan 1 01:00:06 kernel: usb-uhci.c: Detected 2 ports
Jan 1 01:00:06 kernel: usb.c: new USB bus registered, assigned bus number 1
Jan 1 01:00:06 kernel: hub.c: USB hub found
Jan 1 01:00:06 kernel: hub.c: 2 ports detected
Jan 1 01:00:06 kernel: PCI: Enabling device 01:02.1 (0000 -> 0001)
Jan 1 01:00:06 kernel: usb-uhci.c: USB UHCI at I/O 0x120, IRQ 2
Jan 1 01:00:06 kernel: usb-uhci.c: Detected 2 ports
Jan 1 01:00:07 kernel: usb.c: new USB bus registered, assigned bus number 2
Jan 1 01:00:07 kernel: hub.c: USB hub found
Jan 1 01:00:07 kernel: hub.c: 2 ports detected
Jan 1 01:00:07 kernel: usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
Jan 1 01:00:07 kernel: PCI: Enabling device 01:02.2 (0000 -> 0002)
Jan 1 01:00:07 kernel: ehci_hcd 01:02.2: PCI device 1106:3104
Jan 1 01:00:07 kernel: ehci_hcd 01:02.2: irq 2, pci mem c00a6000
Jan 1 01:00:07 kernel: usb.c: new USB bus registered, assigned bus number 3
Jan 1 01:00:07 kernel: PCI: 01:02.2 PCI cache line size set incorrectly (0 bytes) by BIOS/FW, correcting to 32
Jan 1 01:00:07 kernel: ehci_hcd 01:02.2: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
Jan 1 01:00:07 kernel: hub.c: USB hub found
Jan 1 01:00:07 kernel: hub.c: 4 ports detected
Jan 1 01:00:07 kernel: usb.c: registered new driver usblp
Jan 1 01:00:07 kernel: printer.c: v0.13: USB Printer Device Class driver
Jan 1 01:00:07 kernel: hub.c: connect-debounce failed, port 2 disabled
Jan 1 01:00:08 kernel: hub.c: new USB device 01:02.2-2, assigned address 2
Jan 1 01:00:08 kernel: usb.c: USB device 2 (vend/prod 0x457/0x151) is not claimed by any active driver.
Jan 1 01:00:09 kernel: usb.c: registered new driver audio
Jan 1 01:00:09 kernel: audio.c: v1.0.0:USB Audio Class driver
Jan 1 01:00:09 kernel: Linux video capture interface: v1.00
Jan 1 01:00:09 dnsmasq[74]: DHCPREQUEST(br0) 192.168.1.157 00:11:09:d7:16:d8
Jan 1 01:00:09 dnsmasq[74]: DHCPNAK(br0) 192.168.1.157 00:11:09:d7:16:d8 lease not found
Jan 1 01:00:09 kernel: SCSI subsystem driver Revision: 1.00
Jan 1 01:00:10 kernel: Initializing USB Mass Storage driver...
Jan 1 01:00:10 kernel: usb.c: registered new driver usb-storage
Jan 1 01:00:10 kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jan 1 01:00:10 kernel: Vendor: USB 2.0 Model: Flash Disk Rev: 0.00
Jan 1 01:00:10 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jan 1 01:00:10 kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Jan 1 01:00:10 kernel: SCSI device sda: 2048000 512-byte hdwr sectors (1049 MB)
Jan 1 01:00:10 kernel: sda: Write Protect is off
Jan 1 01:00:10 kernel: Partition check:
Jan 1 01:00:10 kernel: p1 p2 p3
Jan 1 01:00:10 kernel: USB Mass Storage support registered.
Jan 1 01:00:10 kernel: vlan1: Setting MAC address to
Jan 1 01:00:10 kernel: vlan1: add mcast address to master interface
Jan 1 01:00:10 kernel: vlan1: add mcast address to master interface
Jan 1 01:00:10 udhcpc[103]: udhcpc (v0.9.9-pre) started
Jan 1 01:00:10 kernel: vlan1: add mcast address to master interface
Jan 1 01:00:10 dhcp client: deconfig: lease is lost
Jan 1 01:00:11 udhcpc[103]: Lease of obtained, lease time 143994
Jan 1 01:00:11 kernel: kjournald starting. Commit interval 5 seconds
Jan 1 01:00:11 kernel: EXT3 FS 2.4-0.9.19, 19 August 2002 on sd(8,2), internal journal
Jan 1 01:00:11 kernel: EXT3-fs: recovery complete.
Jan 1 01:00:11 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jan 1 01:00:11 kernel: Adding Swap: 96380k swap-space (priority -1)
Jan 1 01:00:12 dhcp client: bound IP :
Jan 1 01:00:13 dnsmasq[74]: DHCPDISCOVER(br0) 00:11:09:d7:16:d8
Jan 1 01:00:13 dnsmasq[74]: DHCPOFFER(br0) 192.168.1.157 00:11:09:d7:16:d8
Jan 1 01:00:13 dnsmasq[74]: DHCPREQUEST(br0) 192.168.1.157 00:11:09:d7:16:d8
Jan 1 01:00:13 dnsmasq[74]: DHCPACK(br0) 192.168.1.157 00:11:09:d7:16:d8 ad
Jan 1 01:00:13 dnsmasq[74]: read /etc/hosts - 5 addresses
Jan 1 01:00:13 dnsmasq[74]: reading /tmp/resolv.conf
Jan 1 01:00:13 dnsmasq[74]: using nameserver 195.34.133.22#53
Jan 1 01:00:13 dnsmasq[74]: using nameserver 195.34.133.21#53
Jan 1 01:00:20 kernel: VFS: Can't find ext3 filesystem on dev sd(8,1).
Jan 1 01:00:20 kernel: MSDOS FS: Using codepage 950
Jan 1 01:00:20 kernel: MSDOS FS: IO charset cp950
Jan 1 01:00:20 USB storage: vfat fs mounted to /tmp/harddisk
Jan 1 01:00:20 kernel: VFS: Can't find ext3 filesystem on dev sd(8,3).
Jan 1 01:00:20 kernel: MSDOS FS: Using codepage 950
Jan 1 01:00:20 kernel: MSDOS FS: IO charset cp950
Jan 1 01:00:20 kernel: FAT: bogus logical sector size 43968
Jan 1 01:00:20 kernel: VFS: Can't find a valid FAT filesystem on dev 08:03.
Jan 1 01:00:20 kernel: FAT: freeing iocharset=cp950
Jan 1 01:00:20 kernel: FAT: bogus logical sector size 43968
Jan 1 01:00:20 kernel: VFS: Can't find a valid FAT filesystem on dev 08:03.
May 10 18:49:13 FTP server: daemon is started
May 10 18:49:22 login[141]: root login on `pts/0'
May 10 18:49:22 ntp client: Synchronizing time with time.nist.gov ...


Thx for help guys

acko
10-05-2006, 18:12
When I try 192.168.1.1:81 browser display The requested URL '/' resolves to a file which is marked executable but is not a CGI file; retrieving it is forbidden.

acko
11-05-2006, 09:42
Plsss help me someone

Datafreak
11-05-2006, 09:48
please test this config:

dir=/opt/share/www
port=81
user=nobody
nochroot
nosymlink
novhost
logfile=/opt/var/log/thttpd.log
pidfile=/opt/var/run/thttpd.pidd

Datafreak
11-05-2006, 11:04
Sorry 4 my bad english.

I have the same problem when i chance the first line to "dir=/tmp/harddisk/share/www".


403 Forbidden
The requested URL '/' resolves to a file which is marked executable but is not a CGI file; retrieving it is forbidden.
thttpd/2.25b PHP/5.1.4

In the dir (/tmp/harddisk/share/www) I have make a index.htm

"dir=/opt/share/www" = work
"dir=/tmp/harddisk/share/www" = don't work

MFG
Datafreak

acko
11-05-2006, 16:05
THX for reply, I will try it

acko
11-05-2006, 20:27
I unplugged power cable from asus and plug it back, mount command from post-boot not working

this is my post-boot

#!/bin/sh
# wait for /opt to mount
mount /dev/discs/disc0/part1 /opt
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

# Activate swap
swapon /dev/discs/disc0/part2

# Run all active services - active means starts with S
/opt/etc/init.d/rc.unslung

after unplugged and plugged cable i have

df

/tmp/harddisk/part1
/tmp/hardisk

I must put in command line manually

mount /dev/discs/disc0/part2 /opt
swapon /dev/discs/disc0/part3

All of those 3 partiton is logical fat32,ext2,swap

After I reboot thttpd servcice is running, something like memory error

Thanx for help

Styno
12-05-2006, 08:29
All the stuff that you need a harddisk for should be in the post-mount script.

acko
12-05-2006, 09:56
ok I reset my router and configure it again, mounting working ok, thttpd start after reboot normal, but thttpd working only several minutes and dies, i must reboot my router and after that thttpd working several minutes too and again and again ...