# Apache only local, external not working



## tynelson (Dec 6, 2009)

First and foremost, thank you SO much if you can help me.

I'm a Web Designer that took on a dedicated server job, and I am somewhat familiar with freebsd and how to run commands and navigate appropriately, but I'm having a problem with Apache.

I can access everything within my own network at home, but when I try and access it outside of my home (external), all that shows up is the default Apache page that says "it works."

I've attached what I believe are the relative documents.  
httpd.conf
httpd-vhosts
hosts
rc.conf

I would be so thankful for any help.

Best,
-Tyler


----------



## aragon (Dec 6, 2009)

How are you accessing it at home?  How are you accessing it from outside?  Where in your file system is the doc root?


----------



## beastie_007 (Dec 6, 2009)

First, go back to basic. Which means, try for the first time your real basic domain.com and put a # for all other httpd-vhosts.conf so that only your default apache22 works with the real domainname or your internal or externel ipadress. When it works lik you want, go then further with the other domains with the httpd-vhosts.conf and don't forget to delete the # in your httpd.conf the line 

```
#Include etc/apache22/extra/httpd-vhosts.conf
```

1. hosts.txt
maybe these lines would work better

```
::1			localhost localhost.i2bnetworks.com
127.0.0.1		localhost localhost.i2bnetworks.com
66.181.24.10            deds1124.i2bnetworks.com
```
if you work behind a firewall / proxy (hardware firewall)

```
::1			localhost localhost.i2bnetworks.com
127.0.0.1		localhost localhost.i2bnetworks.com
192.168.x.x             deds1124.i2bnetworks.com
```

2. httpd-vhosts
.....yours

```
<Virtualhost *:80>
    ServerAdmin [email]ty@tvnstudios.com[/email]
    DocumentRoot "/usr/local/www/apache22/data/www"
    ServerName [url]www.domain.tld[/url]
    ServerAlias domain.tld [url]www.domain.tld[/url]
    <Directory "/usr/local/www/apache22/data/www">
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
    </Directory>
    ErrorLog /var/log/httpd-error.log
    CustomLog /var/log/httpd-access.log combined
</Virtualhost>
```

try this one and change 'dummy-host' with the real.host.name


```
<VirtualHost *:80>
    ServerAdmin [email]ty@dummy-host.tvnstudios.com[/email]
    DocumentRoot "/usr/local/www/apache22/data/www"    
    DocumentRoot "/usr/local/docs/dummy-host.tvnstudios.com"
    ServerName dummy-host.tvnstudios.com
    ServerAlias [url]www.dummy-host.tvnstudios.com[/url]
    ErrorLog "/var/log/dummy-host.tvnstudios.com-error_log"
    CustomLog "/var/log/dummy-host.tvnstudios.com-access_log" common
</VirtualHost>
```

for the others ,the same way but other hosts.example.com

in your /etc/rc.conf:
---------------------
is only one line for the http server

```
apache22_enable="YES" (add also below this line the next line)
apache22_http_accept_enable="YES"
```


good luck,
beastie_007


----------



## tynelson (Dec 6, 2009)

Thanks for writing Aragon!    :e

DocumentRoot "/usr/local/www/apache22/data"

That's where data show when I access
http://66.181.24.10
from my home browser.
But, from an external browser, when I access that same address ,
I only get the "It Works" page.
Also, from home I can access the document root and see other pages I've uploaded, also manage my mailman mailing system from there...
but externally I can't get any of that, and only get the "it works" page.

The doc root is listen in the httpd.conf as that.

Also, beastie!  Thanks for writing also=I'm going to read your post now 
Best and SO much thanks!  It's nice to not be figuring this out alone.

-tyler


----------



## tynelson (Dec 7, 2009)

*Apache,only local, not external*

Beastie,

Thank you for all that information!  I tried everything you said and it still didn't go correctly for me.  In fact...nothing really changed  

What could be some other options?  I'm attaching the files with the changes you suggested, I might have changed the back in a couple ways because it didn't work.  As of now, these files all it to work locally just perfectly..but not outside of my network-thank god I have another computer connected to a separate network to check these things.

I'm so thankful for your time...this had been a problem of mine for 2 weeks.

Best,
-Tyler


----------



## anomie (Dec 7, 2009)

@tynelson: A good habit to get into is reviewing your logs while troubleshooting. Open a couple terminals and tail(1) both your error log and your access log while making the request from each place (local and external).

These contain important information about how Apache web server is processing the request.


----------



## beastie_007 (Dec 8, 2009)

Apache,only local, not external....

It's just like what anomie said, ......' reviewing your logs while troubleshooting' .

sorry that i couldn't help you to resolve the problem of your webserver

Beastie_007


----------



## Anonymous (Dec 9, 2009)

This issue sounds very odd. If you are able to see the "It works!" message then the server can obviously be accessed from outside the network, the only conclusion that can be drawn from this is that the server is serving a different document to hosts not on the local network. The only reason that would happen is if you did something to the httpd.conf file.


----------



## tynelson (Dec 9, 2009)

*thanks mharvey *

I agree with you completely! That's why I attached the httpd.conf file above..
it's so weird..

I'm still trying to figure this thing out.  If I get it solved I'll let everyone know what the problem was incase this happens to anyone else.

Best,
-Ty


----------

