Hello everyone--

I've installed everything on my OS X 10.4 system and drupal runs perfectly on my own machine using "localhost/drupal" as specified in the handbook. Now, I want to serve the site off of my own computer so external users can access it and add content before moving the whole thing to a hosting service.

I'm on a verizon DSL, which blocks port 80, so I've changed apache's port to 8081 and am forwarding all calls to this port to my local IP on the network. I am succesfully serving other webpages to external users from my local machine through the WAN IP (http://xxx.xx.xx.x:8081). But when I attempt to start drupal (with http://xxx.xx.xx.x:8081/drupal) I get a "can't find server" error message.

I've searched the forums on this issue and changed the base_url variable in the settings.php file in the sites/default directory (also tried changing the sites/localhost settings file too) to 'http://xx.xxx.xx.x:8081/drupal' which appears to have fixed this problem for others, but I still get the 'can't find server' message when I try to acces the page externally. I know my OS X apache setup is working, because I can get the default apache index page every time.

I'm running the latest version of drupal installed at Library/WebServer/Documents/drupal as recommended.

I'm hoping that there's another settings file that needs to be edited that I'm missing, or somesuch similar easy fix that I just don't know about. Do I have to change something in the /includes directory too?

If anyone here has any advice, that would be magnificent.

Thanks very much.

Comments

pobster’s picture

Are you running through a proxy? I wonder if your proxy doesn't allow that port automatically? I know I use squid and I have to specify webmins port myself so that squid knows it's 'safe' and allows me to access on it? Just a thought... Your problem may not be Drupal related? Especially as like you said, external users can access just fine?

Hmmm... Okay I just read that you can access the apache default index page... That scuppers my theory... Unless you meant you get the page on port 80? More info needed! :o)

Pobster

TLh’s picture

It's a silly oversight, but do you have the appropriate listen directive in your apache httpd.conf ?

-TLh

pobster’s picture

Remember that he said it's fine for external users... It's more likely to be a 'hosts' issue or some issue with accessing the localhost being blocked or incorrectly configured. Actually that's a good point.. When you access your www.mysite.com all the internet does is change that into your IP address. Your router then erm, routes that request to the correct listening PC. On your own network its different, you need to have your /etc/hosts (or whatever it is on OS X) point to your local network set up with lines like:

192.168.0.10 www.mysite.com

You need to have this on every PC on your local network... Well, at least I know I do... None of my Windoze PCs can access my sites hosted on my gentoo box without it, they bring up my routers settings page if I don't have it configured correctly. In Windows its in /c/windows/system32/drivers/etc but it's all the same thing.

Just blah, blah, blahing...

Pobster

twoblackeyes’s picture

thanks for checking this out everyone--

I may have confused with my initial posts: external users can see my apache index page through the new port 8081 just fine; the problem occurs when external users try to access the drupal site at xx.xx.xxx.xx:8081/drupal.

I only changed the port setting in one place in httpd.conf--don't think i changed the listen port (and I'm at work right now and can't get to it), but I'm assuming that's not the problem since apache correctly serves up the default index? I'm not running on a proxy either.

I've run into similar problems seeing the router config page when I try to access the site internally on a PC, but the problem i'm trying to get to the bottom of is indeed a problem with external users. Sorry if that was confusing before.

Do you guys think this is a problem with base_url? Should it read 'http://my.wan.ip.xx:8081/drupal' in /sites/default/settings.php? That's the way I have it now, but still no luck.

Thanks again--hopefully some sort of eureka moment will come.

twoblackeyes’s picture

can someone just tell me if I've got base_url correct for this setup? 'http://my.wan.ip.xx:8081/drupal'?
And do I have to enter this anywhere else besides sites/default/settings.php?

I'm having no luck with this, and it looks like there's at least one other person who's having similar problems.

Thanks

Prometheus6’s picture

It's not your fault. Try entering http://drupal.org:80/node/33240 --that should display this very page.

I reported a similar weirdness.
http://drupal.org/node/32761

pobster’s picture

Okay! Just to check some things which we'll kick ourselves later over if any are the answer...

In httpd.conf, you do have your directory index set to be able to display php index files right...?

ie. does it read something like:

DirectoryIndex index.php index.html index.html.var

Also, as your Drupal installation is in a directory - did you give apache the correct 'permissions' to be able to access this directory? You need to either specify a <Directory> for each directory or use a wildcard - * - to specify that everything is accessable to apache.

As a test, I recommend copying your apache installation index.html file into your Drupal directory and then see if you can access it in there.

Pobster

twoblackeyes’s picture

I will check these things out tonight and report back. Thanks. Weird that :80 on the drupal site doesn't work.

twoblackeyes’s picture

OK, so the solution was ridiculously easy, and I can't believe I never spotted it.

I simply had to change the $db_url as well to include my wan ip and new port number. Now everything works fine.

It was also important that i added index.php to the httpd.conf file as you said, because that allowed me to get to the database error message which led me to my mistake. Thanks for pointing that out.

So I'll probably be back with another idiotic problem in the next week or so as my site grows!

pobster’s picture

Any more problems, ask away! :o)

Usually I don't have the answer because I'm clever, more because I've made the exact same mistakes in the past!!!

Pobster