1

I've the latest WAMP stack installed locally on my machine, with a Wordpress application running fine on http://localhost/my-web-app.

I'm attempting to connect to this application from another device within my home network.

I made a change to the httpd.conf www section, where previously it had

Require local I've changed it to

Requite all granted

I am able to access the Apache home page by invoking this URL from my device: http://192.168.1.118:80/

However, once I change to http://192.168.1.118:80/my-web-app then the URL in my phone's browser changes to http://localhost/my-web-app and obviously is not able to find it.

I've disabled my Comodo firewall, so there is no firewall running or any anti virus

The httpd.conf file contains the following:

    ServerSignature On
ServerTokens Full

ServerRoot "c:/Development/wampserver/bin/apache/apache2.4.9"

Define APACHE24 Apache2.4
Listen 0.0.0.0:80
Listen [::0]:80

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cache_module modules/mod_cache.so
LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule php5_module "c:/Development/wampserver/bin/php/php5.5.12/php5apache2_4.dll"

<IfModule unixd_module>
User daemon
Group daemon

</IfModule>


ServerAdmin admin@example.com

ServerName localhost:80

HostnameLookups Off

DocumentRoot "c:/Development/wampserver/www/"

<Directory />
    AllowOverride none
    Require all granted
</Directory>


<Directory "c:/Development/wampserver/www/">
    Options Indexes FollowSymLinks

    AllowOverride all


    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "c:/Development/wampserver/logs/apache_error.log"

LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "c:/Development/wampserver/logs/access.log" common

</IfModule>

<IfModule alias_module>


    ScriptAlias /cgi-bin/ "c:/Development/wampserver/bin/apache/apache2.4.9/cgi-bin/"

</IfModule>

<IfModule cgid_module>
</IfModule>

<Directory "c:/Development/wampserver/bin/apache/apache2.4.9/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig conf/mime.types

    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
</IfModule>
EnableSendfile off

AcceptFilter http none
AcceptFilter https none
Include conf/extra/httpd-autoindex.conf

<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


Include "c:/Development/wampserver/alias/*"

What configuration do I need to change here?

10
  • You have to change the Apache listening IP. Probably to 0.0.0.0 so it listens on all. Also, on WordPress you'll need to change the URL in the site settings so it updates the DB to locate the relevant pages such as CSS, JS etc. – Kinnectus Mar 15 '15 at 16:08
  • I've added the Listen section of my httpd.conf file above. I don't think Wordpress has any issue yet. If I look at my access logs, there is no entry there for my requests so it's not reaching Wordpress yet – DJoyce Mar 15 '15 at 16:47
  • WAMP has a tool that allows you to configure it for public access with a one-click system tray icon, doesn't it? – Kinnectus Mar 15 '15 at 23:21
  • Are you referring to Put Online/Offline? I have it online anyways – DJoyce Mar 16 '15 at 0:02
  • 1
    Yes that's what I'm referring to :) have you changed your WordPress settings (through WordPress) to be your IP rather than localhost? This is important as WordPress will update its links and its .htaccess files. – Kinnectus Mar 16 '15 at 8:27
0

OK this is a quirk of WordPress.

When you install WordPress it stores the domain you install it into in its database. So if you install it on localhost/my-app that is what will get stored in its database.

Now when it is connected to remotely it uses the domainname it stored and therefore when you try to access it from your phone the url gets changed as you are seeing.

Now its possible to change this stored domain name in the WP database, its probably better if I just give you a link here as it is well documented on the WP Codex

So you just have to rename the url to something that can be accessed from your phone ( without having to twiddle anything ) and other PC's on the LAN.

So I suggest you use the ip address of the PC running WAMPServer so for example, change the url to http://192.168.1.118/my-web-app

2
  • Unfortunately, this is not the solution. I attempted this via the "Edit wp-config.php" suggestion, but seeing the same results. I think this is an Apache issue and not a Wordpress issue, with some sort of redirection going on – DJoyce Mar 21 '15 at 3:04
  • Use the Changing Your Domain Name and URLs method, because that basically what you are doing. – RiggsFolly Mar 22 '15 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.