LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-24-2003, 06:20 AM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Tricky apache configuration


I have an internal apache webserver on our LAN, named castor.foo.bar. The server provides access to documentation areas and user's home directories on castor.foo.bar.

I wanted to make this server available from the internet safely, so I redirected port 80 to port 443 on castor.foo.bar by stunnel, and forwarded port 443 of castor to port 443 of our internet firewall machine mail.foo.bar (we have only this one domainname registered).

I can connect to the webserver using https://mail.foo.bar/, and I can view any documents in and under the server's document root directory, but I have problems with links pointing out of the document root directory of the server: when clicking to such links, I get errors like 'castor.foo.bar not found'.
This is the case e.g. when I try to connect to user's home directories. (https://mail.foo.bar/~username)

I know this error is due to the fact that I connect to the server using URL https://mail.foo.bar/, while the apache server knows itself as castor.foo.bar.

If possible, I want to avoid advertising castor.foo.bar as a registered domain name on the internet, i.e. I would prefer further using URL mail.foo.bar.

Do you know a workaround, maybe an apache configuration option addressing this situation?
 
Old 08-24-2003, 07:18 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Try setting the ServerName directive in httpd.conf to mail.foo.bar then restart apache.
 
Old 08-24-2003, 07:44 AM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
I already tried that, it had no effect.

Meanwhile I found that the problem is more serious: browsing any directories even in the document root gives the same error message (castor.foo.bar not found).
 
Old 08-24-2003, 08:01 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
What are your urls in the html referencing? just from the document root or the whole url?
 
Old 08-24-2003, 08:53 AM   #5
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
An example:

Entering the following URL from within our LAN shows the contents of directory /usr/local/www/Web/documents in server castor:
http://castor.foo.bar/documents/

Entering the following URL from outside our LAN gives nothing but the error:
https://mail.foo.bar/documents/

Since the document root is /usr/local/www/Web for both virtual servers (castor.meei.hu and mail.meei.hu), both URL should point to the same directory.
From the outside, I can only view html files, and documents to which a relative link points from a html file.
Any html pages auto-generated by apache, like contents of a directory, even if within the document root path, fail to show up if requested from the outside.

Last edited by J_Szucs; 08-24-2003 at 08:56 AM.
 
Old 08-24-2003, 09:03 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Can you post httpd.conf
 
Old 08-24-2003, 09:21 AM   #7
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
I am sorry to mislead you (and myself), but the problem turned out to be due to missing trailing slashes when typing in the URLs of directories.
I was misled by the error message: 'unknown machine: castor.foo.bar' which did not help me in the right direction.
Anyway, thanks for you kind attention.
 
Old 08-24-2003, 09:24 AM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
No problem - good to know you got it working .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache configuration BoardinBum Linux - Networking 3 12-29-2004 06:53 AM
Apache 2 configuration kvtournh Linux - Newbie 1 11-13-2003 06:45 AM
Apache 2 Configuration..... odgey Linux - Software 2 06-27-2003 03:20 AM
Apache -> Configuration Cybers19 Linux - Newbie 3 06-17-2003 02:19 PM
A Tricky question in Apache!! RKris Linux - Software 1 02-20-2003 09:19 AM


All times are GMT -5. The time now is 05:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration