Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 13th, 2002, 10:40 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
htaccess

I have an .htaccess file in my htdocs directory that i use to point to my own error messages. The problem is that i can only get these error messages to show when i use my ip address:

http://123.123.25.25/some_bogus.html (not actual ip, as i am sure you realised) But when i use my actual domain name. www. it calls the default error messages.

I use the following in my htaccess file which works fine as i mentioned above, but only with my ip address in the browser bar. I use this pearl program as it e-mails me about bad pages etc, until i become more experienced.

ErrorDocument 401 /cgi-bin/guardian/ag.pl
ErrorDocument 403 /cgi-bin/guardian/ag.pl
ErrorDocument 404 /cgi-bin/guardian/ag.pl
ErrorDocument 500 /cgi-bin/guardian/ag.pl

Any ideas of what the problem is would be greatly appreciated.

Kind regards

Phil
(As you guessed a newbie)

Reply With Quote
  #2  
Old March 13th, 2002, 03:28 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It appears that your www.domain.com doesn't resolve to 123.123.25.25 or can't determine its ServerName.

Reply With Quote
  #3  
Old March 14th, 2002, 01:07 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry but when you say resolve what are you meaning, and is there a way of working around it.

Phil

Reply With Quote
  #4  
Old March 14th, 2002, 06:47 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Zip and attach your httpd.conf here.

Reply With Quote
  #5  
Old March 14th, 2002, 06:55 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Zip file as requested

Phil
Attached Files
File Type: zip httpd.zip (12.6 KB, 207 views)

Reply With Quote
  #6  
Old March 14th, 2002, 07:18 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Why you define <Directory "C:/Program Files/Apache Group/Apache/htdocs"> twice?

You don't need to use .htaccess at all. Just put those ErrorDocument lines in httpd.conf anywhere not within any <xxx></xxx> block.

Reply With Quote
  #7  
Old March 14th, 2002, 07:23 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was not aware that i had placed it in twice, but does it matter? Everything seems to run fine? If it does then i can take it out. I will try as you have suggested.

Thanks

Phil

Reply With Quote
  #8  
Old March 14th, 2002, 07:32 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have done as you suggested, but i am still presented with the same problem. If i use my domain name with a bogus html page, it reverts to the standard 404 error. If i use my ip address with a bogus html page i can get the new 404 error page??


One more thing, does it matter that i have web forwarding? Could this be the problem?

Thanks

Phil

Reply With Quote
  #9  
Old March 14th, 2002, 07:47 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I was not aware that i had placed it in twice

Yes because your Options and AllowOverride for the two are different and .htaccess relies on that.
If you place those ErrorDocument lines in httpd.conf then you don't have to worry about AllowOverride at all.

>> does it matter that i have web forwarding?

Absolutely and no wonder. You need to remove or comment out that ServerName line. Apache will determine all of its available ServerName on startup automatically. Like I said in my very first reply, Apache was unable to determine www.domain.com from its own because your ServerName's domain is for external.

Reply With Quote
  #10  
Old March 14th, 2002, 08:04 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have commented out the servername as suggested, I now get the following message on starting the server:

"Could not determine the server fully qualified domain name using ip xxx xxx xx xx as servername."

I presume you knew that it would say that.

SORRY!! But I am still getting the same problem.


Phil

Reply With Quote
  #11  
Old March 14th, 2002, 08:19 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I presume you knew that it would say that

Yes but that should work though. Or you can even try to set the internal.domain.com as the ServerName. That internal.domain.com should be the FQDN of your box. The one that maps to your 192.168.0.2 or whatever LAN IP.
Also, set UseCanonicalName to off, it's almost always off but it's on by default.

Reply With Quote
  #12  
Old March 14th, 2002, 08:37 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am starting to get a little lost now, excuse my ignorance.

Set the internal.domain.com as the ServerName. ????

That internal.domain.com should be the FQDN of your box. The one that maps to your 192.168.0.2 or whatever LAN IP. ????

I have a page with my service provider that just uses a bit of Java to redirect to my actual server at home, my domain name is forwarded to that page i then redirect to me here at home. Not sure if this is of any help to you at all.

I have turned off CanonicalName though.

I am very sorry i am appearing to be a little dim, but could you put it in even easier lingo than you probably are???

If you get fed up of trying to assist me, please say i have broad shoulders & won't take it to heart.

Reply With Quote
  #13  
Old March 14th, 2002, 09:00 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry I still don't have a clue of your server + network setup. Do you have a hardware router sitting in front of your Windows box running Apache?
That IP -> 213.171.193.45, was it assigned to your router, another box or your windows box?
Does your Windows box (running Apache) have direct internet connection or is it behind a router with 192.168.x.x assigned to it?

Reply With Quote
  #14  
Old March 14th, 2002, 10:08 AM
pgreen50 pgreen50 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 22 pgreen50 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, its possibly me not explaining myself correctly.

I have apache running on windows XP- works fine.

I have a broadband connection through an external modem provided by my cable supplier. This connection is on 24/7. My IP address provided from my cable supplier is DHCP assigned, i do not switch off so i basically keep the same IP address.

Ok so far i hope.

The same cable provider gives me web space but none of the other stuff, hence my own server. I use a simple page with a Java redirection script embedded within this page to direct anyone who goes to that page to my own IP address (my server at home).

One final routing!!

I purchased a domain name with web & e-mail forwarding, they direct the domain name to the free web page space provided by my cable operator.

Domain name - to - cable provider page - to - my own server.

I hope this helps a little, if it cannot be done, no worries it would have just been nice to have had my own error pages, everything else works a treat.

One other thought, would it be better to have my web forwarding going directly to my IP address & missing out the cable providers page.

Phil

Thanks for trying to assist me.

Reply With Quote
  #15  
Old March 14th, 2002, 07:05 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I use a simple page with a Java redirection script

Which exact page? The default index.html page? How about http://www.domain-at-cable-host.com/another-page.html?
And what should be done when someone goes to that page?

>> they direct the domain name to the free web page

So they basically assigned an A record of your domain to point to your cable provider's IP.

>> it would have just been nice to have had my own error pages

You then have to use external error redirection by specifying the Full URL, not just absolute URI path to ag.pl.

>> would it be better to have my web forwarding going directly to my IP address

If your IP doesn't change, then of course. Or you should ditch that webhost and sign up for a dynamic DNS hosting service.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > htaccess


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |