LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-07-2009, 08:15 AM   #1
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Rep: Reputation: 30
Drupal & Port Forwarding issues


I have a Debian box running Drupal behind a D-Link G604T Modem/Router which is configured to forward requests to the apache ports (80 and 443) on to the Drupal Server.

2 Issues:

1) Drupal complains that "HTTP Request Status Fails". I have noticed, from googling, that the modem does not allow 'loopbacks'. Could this be causing the issue?

2) My /etc/resolv.conf file is being overwritten presumably by the D-Link's DHCP. The overwritten file points to the D-Link as the nameserver, which is not resolving domain names.

Anyone got any experience of these?

I suspect the second issue will be a lot easier to solve.

Last edited by cov; 12-07-2009 at 08:19 AM.
 
Old 12-08-2009, 02:33 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
What is being logged on the web server serving the drupal ?
 
Old 12-08-2009, 04:12 AM   #3
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Hi Topdog,

I see you're based in Jossburg. I'm in Lanseria at the mo, but I'll be headed back to Durbs just as soon as I can...

Anyway, back on Topic...

The /var/log/apache2/access.log doesn't show much:

Code:
server:~# tail /var/log/apache2/access.log
41.26.128.214 - - [08/Dec/2009:11:49:33 +0200] "GET /inenergy/?q=admin/reports HTTP/1.1" 200 4356 "http://inenergy.org/inenergy/?q=admin/content/node/overview" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.26.128.214 - - [08/Dec/2009:11:49:37 +0200] "GET /inenergy/sites/default/files/logo.jpg HTTP/1.1" 304 - "http://inenergy.org/inenergy/?q=admin/reports" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.26.128.214 - - [08/Dec/2009:11:49:37 +0200] "GET /inenergy/sites/default/files/favicon.ico HTTP/1.1" 304 - "http://inenergy.org/inenergy/?q=admin/reports" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.26.128.214 - - [08/Dec/2009:11:49:42 +0200] "GET /inenergy/?q=admin/reports/status HTTP/1.1" 200 5116 "http://inenergy.org/inenergy/?q=admin/reports" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
This is the Drupal Error:
Code:
HTTP request status	Fails
Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.
I think it's do do with a complicated security model by which Drupal puts out http calls via php which I have a feeling my router doesn't accept. (I could be wrong in this).
 
Old 12-08-2009, 04:20 AM   #4
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
Cool, nice to chat to an SA mate, This seems to be a networking issue based on the name resolution.

Went you make the connection from outside, the D-Link does the correct thing, it forwards the packet to the drupal system on the inside, the system on the inside however trieds to make its own http connection to itself, (inenergy.org) this resolves to the external IP on the D-Link, the packet is sent out to the D-Link which then fails to send the packet back to the drupal host.

The work around is to create a mapping for inenergy.org to the internal ip address on the machine running drupal. You can use /etc/hosts for that.

Such that when drupal requests for inenergy.org it will resolve to itself.
 
Old 12-08-2009, 05:11 AM   #5
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Okay, I had
Code:
140.211.166.6 updates.drupal.org
in /etc/hosts: just shows how well I understood the process :?

[Update]
My /etc/hosts is as follows:
Code:
cat /etc/hosts
127.0.0.1	localhost
67.209.103.126	server.inenergy.co.za	server

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.1.5 inenergy.org
But I'm still getting the same error.

Could it be due to the 67.209.103.126 server.inenergy.co.za server line?
 
Old 12-08-2009, 05:17 AM   #6
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
No that should not affect it, from the logs you posted, a redirection is being made to inenergy.org. Maybe that is not what is generating the error, is there anything different in the logs ?

If you cannot see anything then maybe you can go low level to debug it by using tcpdump to see which requests are being made.
 
Old 12-08-2009, 01:03 PM   #7
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by datopdog View Post
No that should not affect it, from the logs you posted, a redirection is being made to inenergy.org. Maybe that is not what is generating the error, is there anything different in the logs ?

If you cannot see anything then maybe you can go low level to debug it by using tcpdump to see which requests are being made.
Hi Topdog,

Sorry, I had a meeting I had to dash off to attend. And, as you know, in Jossburg you have to leave at least an hour in hand because the chances are good that several traffic lights are out between you and your destination.

Anyway, it appears that the 2 issues I had were interconnected.

The Router's DHCP had overwritten my /etc/resolv.conf and replaced the opendns nameservers with it's own:

Code:
cat /etc/resolv.conf
nameserver 192.168.1.1
I had appended the opendns nameservers onto the file:

echo "nameserver 208.67.222.222">>/etc/resolv.conf
echo "nameserver 208.67.220.220">>/etc/resolv.conf


Code:
cat /etc/resolv.conf
nameserver 192.168.1.1
nameserver 208.67.222.222
nameserver 208.67.220.220
Which gave me partial success and I could sporadically use wget and aptitude to install tcpdump.

However, once I had removed the nameserver 192.168.1.1 from the resolv.conf, I no longer got the HTTP request status Fails error.

So I guess my problem is partially solved. :?
 
Old 12-08-2009, 11:58 PM   #8
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Which brings me to part 2: How do I stop the Router from overwriting my /etc/resolv.conf?
 
Old 12-09-2009, 12:38 AM   #9
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
Use static network configuration, at the moment your dns information is being provided via dhcp that is why /etc/resolv.conf is being overwritten.
 
Old 12-09-2009, 02:43 AM   #10
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by datopdog View Post
Use static network configuration, at the moment your dns information is being provided via dhcp that is why /etc/resolv.conf is being overwritten.
Yes, I understand that.

Well, I suppose it makes sense. It's just that it's handy being able to take the server out and plug it into my network here to work on without reconfiguring.

Also, I'm a bit charry of what the D-Link router is going to do if it sees the server as a static IP.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables - port forwarding through nat issues web_janitor Linux - Networking 2 01-23-2009 06:16 PM
Questions regarding external IP & port forwarding deke7777 Linux - Server 6 05-31-2007 07:55 PM
Issues with port forwarding pircio Linux - Networking 2 12-19-2005 05:00 PM
IPTABLES & Port Forwarding wobbit Linux - Networking 2 05-06-2005 03:28 PM
Port Forwarding & MNF apoc63 Linux - Newbie 0 01-03-2005 10:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration