Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cant access local apache server pages inside LAN

9 views
Skip to first unread message

Tim

unread,
Apr 22, 2012, 12:01:27 PM4/22/12
to
Hello-

Ive searched for several hours trying to find my issue with no luck so
far.
I have a linux apache server (running a few virtual servers both using
80 and 443 ports) on the net. Users outside my network can access
pages just fine, however if Im
at home and try to access the pages on the linux server itself (or my
other servers
at home) most of the pages arent accessable, just the 'domain.com'
root is,
nothing under it.

The only thing that seems to work is the mydomain.com address, which I
get because
thats the one in my /etc/hosts file, but if I try to do:

mydomain.com/test

I get a 'cannot connect to mydomain.com/test' message

At this point Im unsure whats wrong with my httpd.conf file?
Listen *:80
Listen *:443

<Directory "/home/http/mydomain">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
<LimitExcept GET POST>
</LimitExcept>
</Directory>

# I shouldnt even need this one should I? I was trying it out:
<Directory "/home/http/mydomain/test">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
<LimitExcept GET POST>
</LimitExcept>
</Directory>

My VirtualHost section is setup as follows (I will eventually be using
SSL on this
domain as well, but for now, just 80):

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /home/http/mydomain
ErrorLog logs/mydomain_error_log
ServerName www.mydomain.com
ServerAlias mydomain.com
ScriptAlias /cgi-bin/ "/home/http/mydomain/cgi-bin/"
TransferLog logs/access_mydomain
</VirtualHost>

Can anyone point me as to whats wrong with my configuration?

Andre

unread,
Apr 23, 2012, 9:33:41 AM4/23/12
to
Not shure but trye removing the asterix at the Listen directive making
like Listen :80
if you want to have the sever listening at every adresses set it whit
0.0.0.0
Also verify with netstat |grep http to see if your server is listening
at adresse 127.0.0.1 or only at mydomain..which is what I belive it does.

André

Tim

unread,
Apr 23, 2012, 9:25:20 PM4/23/12
to

> Not shure but trye removing the asterix at the Listen directive making
> like Listen :80
> if you want to have the sever listening at every adresses set it whit
> 0.0.0.0
> Also verify with netstat |grep http to see if your server is listening
> at adresse 127.0.0.1 or only at mydomain..which is what I belive it does.
>
> André

Thank you Andre. So doing Listen :80 complains when starting up http,
so I tried Listen 80 and Listen 443, same issue as before.

netstat -a | grep LISTEN | grep http

gives me: (the other just showed what state connections were in)

tcp        0      0 *:http                      *:*                  
      LISTEN
tcp        0      0 *:https                     *:*                  
      LISTEN

I also tried:
Listen 0.0.0.0:80 no luck either

other ideas?
Thanks

Andre

unread,
Apr 24, 2012, 3:47:13 AM4/24/12
to
did you try Listen 0.0.0.0:80 ??
André

Andre

unread,
Apr 24, 2012, 3:48:37 AM4/24/12
to
Sorry I didn't look carefully enough!
André

Andre

unread,
Apr 24, 2012, 3:55:45 AM4/24/12
to
Le 22/04/2012 18:01, Tim a écrit :
> TransferLog logs/access_mydomainStill thinking

> </VirtualHost>
>
> Can anyone point me as to whats wrong with my configuration?

What exactly is in your /etc/host table?
That should be someting like
12.34.56.78 machine.domaine
The slash test is not allowed in that table.
What about the log files ?
Is the pseudo user under which run apache allowed to that directory ??
( permissions, owner )
André

Tim

unread,
Apr 24, 2012, 9:17:05 PM4/24/12
to

> What exactly is in your /etc/host table?
> That should be someting like
> 12.34.56.78     machine.domaine
> The slash test is not allowed in that table.
> What about the log files ?
> Is the pseudo user under which run apache allowed to that directory ??
> ( permissions, owner )

Ok found the issue. My /etc/hosts file contains:

127.0.0.1 mydomain.com localhost.localdomain localhost
localhost4

which works for doing 'mydomain.com', but what I had to add was
192.168.1.xx mydomain.com

That fixed my issue. My system is behind NAT, so while I also had:

xxx.xx.xx.xx mydomain.com

For timeouts to www.mydomain.com, I added another entry:

192.168.1.xx www.mydomain.com

Fixed!
Thank you for your time and help Andre!

tom...@live.at

unread,
Apr 25, 2012, 2:01:05 AM4/25/12
to
In my config the <Directory> statemens are inside the <VirtualHost>.

Andre

unread,
Apr 25, 2012, 4:41:35 AM4/25/12
to
Le 25/04/2012 08:01, tom...@live.at a écrit :
> In my config the<Directory> statemens are inside the<VirtualHost>.
It's also valid as your directory belong to a Virtualhost!!
André

Tim

unread,
Apr 25, 2012, 11:27:39 AM4/25/12
to
On Apr 25, 1:41 am, Andre <pas.m...@ailleur.be> wrote:
> Le 25/04/2012 08:01, tomb...@live.at a écrit :> In my config the<Directory>  statemens are inside the<VirtualHost>.
>
> It's also valid as your directory belong to a Virtualhost!!
> André

It does make more sense to put <Directory> inside the <VirtualHost>
organizationally,
I agree. I should do that as well.

On a sidenote, a friend of mine suggested that I put my domain in
my /etc/resolv.conf. I believe part of the issue is that nobody has
requested
my DNS for my domain name (including me outside home), so my IP
address
(being served via named/bind on that same server) ever got cached
outside,
so when apache goes to resolve it upstream, it knows nothing about my
IP address.
Im going to try that when I get home tonight as well.
0 new messages