I have a Linksys WRT54G wireless router running DD-WRT open source firmware. A lot of the work I do requires providing access to clients or coworkers to various devices on my local network. I also view the DD-WRT web interface regularly on the Linksys WRT54G to see what devices it can see on the network via ARP or IP. A lot of the time when I attempt to connect to the web server which is only running HTTPS on port 443 the connection via my browser will just hang or simply won’t make a connection at all. During the times when I am unable to open the DD-WRT web interface I am always still able to connect to the Linksys device via SSH meaning that for some reason the web interface is failing.
DD-WRT Admin Web Interface Issue Observations:
I have noticed that when I am unable to bring the DD-WRT admin interface up in a browser that the HTTPD process is running and the port is open leading me to believe that something is hanging within HTTPD itself. At first I would always reboot the Linksys router itself to resolve the problem but to me this had three issues which included the length of time it required to reboot, the loss of connection to the Internet for other devices on my network, and the fact of fixing an issue by rebooting. While troubleshooting the HTTPD issue I noticed a process called process_monitor that actually monitors numerous processes and will restart them automatically if they are not running. The reason HTTPD is not being restarted is because technically it is running and the port is open so process_monitor believes that everything is fine as the checking is not intelligent enough to check if successful connections are made.
Restart HTTPD Using DD-WRT CLI Via SSH Or Console:
There are a couple different ways you can restart the HTTPD process which I will explain below.
- Kill HTTPD Process: The easiest way is to just kill the process and let process_monitor restart it automatically. This can be done by first locating the PID or Process ID of HTTPD and then by issuing the kill command as shown below.Locate HTTPD PID:
- root@wrt54gs:/etc/config# ps | grep http
- 30653 root 2552 S httpd -S
- 30714 root 1172 S grep http
The PID of HTTPD will be the first number in the line showing the HTTPD process running. Notice in this example it is “httpd -S” indicating that HTTPD is only listening on port 443 or only allowing HTTPS connections. Once you know the PID you will use it in the kill command below which will immediately stop the process.
Kill HTTPD Process ID:
- root@wrt54gs:/etc/config# kill -9 30653
Verify HTTPD Is No Longer Running:
- root@wrt54gs:/etc/config# ps | grep http
- 30741 root 1172 S grep http
Notice that “httpd -S” is no longer running and only the command searching for the command will show in the output of the “ps | grep http” command. After a short amount of time (less than a couple minutes) the process_monitor script will notice HTTPD is not running and will restart it automatically. So check in a couple minutes to see if HTTPD is running by using the “ps | grep http” command.
- Stop/Start HTTPD Service: It you prefer to manually stop and start the service immediately you can use the below to commands to stop HTTPD and then start HTTPD.
- root@wrt54gs:/etc/config# stopservice httpd
- root@wrt54gs:/etc/config# startservice httpd
Using either of the above two methods will restart HTTPD and should resolve any issues you may have connecting to the DD-WRT admin web interface. Once restarted you can verify that HTTPD is listening on port 443 if you are only allowing HTTPS connections or port 80 is you are allowing HTTP connections using the below netstat command.
Verify HTTPD Listening On Port 443:
- root@wrt54gs:/etc/config# netstat -an | grep 443
- tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
Now connect to the DD-WRT admin interface and continue your work.
I’ve got the same problem with the httpd hanging, while everything else is still OK. I didn’t want to reboot the box and disrupt routing, so thanks for providing a less disruptive solution.
Hello Eric Smith,
No problem. Glad it helped out. It is nice to know that I am not the only one experiencing this issue with HTTPD hanging. If you end up finding a solution to the process/port hanging let me know and I will do the same.
Thanks.
alex
Hi.
Can’t find httpd -s
only httpd -p 80
but I’ve turn On chekbox https in administration tab.
DD-WRT v24-sp2 (10/10/09) mini-usb-ftp – build 13064
asus wl-520gu
what is the f***ing problem it is?? HELP
Hello Shkur,
After enabling HTTPS did you restart the router? Maybe the changes have not been activated which you could first try to do by saving the configuration change and then applying the configuration change.
I have never used an asus wl-520gu however I assume things are very similar. If you simply need to restart apache then you can kill the “httpd -p 80” process and it should restart itself.
Thanks.
alex
I think it’s bug on v24preSP2
Ill try to make mega with flash drive – maybe it’ll work properly
Hello Shkur,
Did you end up verifying it was a bug with V24preSP2? I am running v24sp2 so if it was a bug in the presp2 I would recommend trying to upgrade to see if it resolves the problem.
Thanks.
alex
Hi.
Not yet. I have “EPIC FAIL” with my hdd. I am now f**king with R-studio and recovering 750gb ((((
Can’t find v24sp2 i see only PRE
Hello Shkur,
Bummer about the hard drive. Let me know if you do locate it.
Thanks.
alex
Alex,
Thanks for your post. I have exactly the same issue and I tried searching the DD-WRT but could not find anything related to it. I too started off by having to reboot the whole damn thing and had the same issues/concerns as you pointed out.
I am using v24 preSP2 (Build13064) – which is the current recommended firmware version for a WRT54GL. I never had this problem with v24 SP1. I notice that there is a v24 preSP2 Build 14311 – so I might try this and see if I get the same issue. Otherwise I might just revert back to SP1.
Regards,
Mon
Hello Mon,
No problem at all. These are my favorite types of posts because they generate comments. Anyhow thanks so much for the detailed response. I will be curious to know what comes of your testing mentioned in the second paragraph above.
Thanks.
alex
Alex,
Looks like Google might not be so evil after all…
I search Google for “dd-wrt httpd hangs” and found the following forum posting:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=35764
It has links to other postings and it looks like it might be the WAN Traffic Counter service might be what is making the web GUI hangs (I think because it uses up a lot of memory over a period of time). I notice I have this service enabled – but I can’t remember whether it was enabled by default or not.
I will disable this and see if after 6 hours if the httpd service is not responding again.
Cheers,
Mon
Hello Mon,
Thanks! I will be curious to know if this resolves the issue so I can try it later. :)
Thanks.
alex
Alex,
I eventually did not disable “WAN Traffic Counter” as I wanted to do some more troubleshooting when the issue occurs. This morning when I checked I could not log in as usual. Use of the ‘ps’ command showed that httpd was using up high CPU – actually it was anywhere between 75% to 100%.
I asked my best friend Google and it found the following links:
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=155711
http://secure.dd-wrt.com/phpBB2/viewtopic.php?t=68566&view=previous&sid=7a7ee440364a5d41b41c951a20b48a53
These suggest a problem with using HTTPS itself for remote access and talks about either disabling HTTPS for remote access – not something I would want to do – or change the SSL port to something other than the default 8080.
I have changed my remote access port now so will see whether that changes anything.
Cheers,
Mon
Hello Mon,
Awesome… thanks for the updates. Will be curious if changing the port actually works! That would seem really odd to me… In fact I would have thought that disabling the WAN Traffic Counter would do the trick because of something resource related. If changing the port does work then it must be some form of task that runs at specified times that causes a conflict or something. Anyway we appreciate the update and look forward to see what the final resolution is!
Thanks.
alex
Alex,
Just to let you know that since my last post, my DD-WRT web GUI has not hung. It seems changing the remote access port from the default does make a difference.
Now that I think of it, I did actually use a different remote port when I was using v24 SP1 – since upgrading to preSP2 I have made some major architectural changes to my wireless setup (I’ve moved home recently) and done lots of upgrades and factory defaults.
Regards,
Mon
Hello Mon,
Awesome. Thanks so much for following up. /me changes port right now. I don’t login that often but it is nice to know I can without having to SSH in to restart HTTPS/HTTP services. Wonder why the port makes a difference… I find it odd but who knows. :)
Thanks again! Hope you like being *home.
Alex
Changing the port seems to have done the trick for me as well on:
DD-WRT v24-sp2 mega (c) 2010 NewMedia-NET GmbH
Release: 08/12/10 (SVN revision: 14929)
One note, I also observed that the httpd process was eventually consuming 99% of my cpu *even if I never tried to reconnect to it after restarting it via killall httpd . Interesting, this problem seems to coincide with the opening of tor ports on my router. I can’t imagine what that would have to do with my httpd consuming 99% of proc, but I did not have this problem prior to opening ports 9001 and 9030.
Hello Craig,
Nice. Thanks for taking the time to leave a detailed response with information that will be useful to others.
Thanks.
alex
also note the tor ports killing the httpd process as well
the ssh kill / service restart works great though..
Thx for the information
Hello viperiii,
Noted, thanks for taking the time to leave feedback.
Thanks.
alex
over complicated even for 2009
i just do
Stop the web interface service:
> stopservice httpd
Start the web interface service:
> startservice httpd
That’s it!