Support » Fixing WordPress » localhost OK but Web access forbidden

  • Resolved JHBrewer


    I just installed (via yum) wordpress on my own Scientific Linux server ( with no trouble. It goes into /usr/share/wordpress and the wp-config.php file is in /etc/wordpress/ — I set DB_HOST to “localhost” and it works great when I access it from the server itself (http://localhost/wordpress).

    But when I try to reach it from the Web ( I get 403 Forbidden. Nothing seems to help. There is no .htaccess file in either directory. I tried making a symlink to /usr/share/wordpress from /var/www/html/ but that had no effect, so I removed it.

    The MySQL database looks fine. I rummaged around and found that the first option in wp_options (namely “siteurl”) is set to “http://localhost/wordpress” which sounds a bit restrictive, so I tried changing same to “” but then nothing worked at all, so I wiped it out and reinstalled. Same result. I suspect there is some point at which I need to say “” instead of “localhost” but I’m tired of guessing and backtracking.

    How is this supposed to work? Most of the docs seem to assume I am running on someone else’s server.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Possibly DNS or Virtual Hosts issue?

    ?? Everything else on seems happy. What Virtual Hosts issue?

    I don’t know – you have the server! 🙂

    I was just throwing out a possibility that maybe you were using a virtual host setup to manage multiple domains on one server and perhaps it was misconfigured thus rerouting requests incorrectly.

    It just seems weird that you can see it fine using localhost but not see it on the internet using your domain name. It does suggest something in your server configuration is not right. It does sound more like a web server support question rather than WordPress.

    Hmmm… my server does function as several different domains, but all that seems to work just fine for everything but WordPress. Does it have some special sensitivity to such things? I can sort of see how this might be so — how does Apache know to find wordpress in /usr/share/ ??

    Well, thanks to all the generous assistance and transparent, complete documentation, I was able to figure it out on my own. 😉 Apparently if you are cautious at installation time and specify access only from localhost, it embeds this restriction in numerous places so that you need to dig yourself out step by step to get it to be accessible from the outside. I should think this would be a fairly common scenario, but no allowance seems to be made for it.

    Anyway, in case others have run into the same sort of problem, you need to change the Apache file wordpress.conf to include “Allow all” — pretty permissive, but I guess that’s what it means to “go public”.

    This, however, is not enough. You also need to change the first entry in the blog_options table (or whatever you called it) — the “siteurl” option — to your externally visible URL, instead of “http://localhost/wordpress“.

    I was unable to find any reference to this, or any way to make the change other than manually altering the database contents. This seems pretty sketchy, but the alternative (AFAIK) is to wipe out wordpress and reinstall — in which case any content already entered is presumably lost.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘localhost OK but Web access forbidden’ is closed to new replies.