Cannot access wp admin on another computer in local network - wordpress

I have created a wordpress website on a wampserver 3.2.6 and wanted to access the website, as well as admin panel from another device(pc) on a local network but I get an error (err_refuse_to_connect). I have read some topics and tested some solutions and it partially works. The page loads when I type ip address of the server where the website is, but only text loads, without images and I cannot access the admin panel. I have configured httpd-vhosts.conf file like this:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot D:/wamp64/www
<Directory "D:/wamp64/www">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Also I have created a rule in firewall to allow inbound connections on port 80 and added ip address of a computer I want to connect in hosts file. Is there any simple and clear solution for this?

Change your wordpress setting's URL to a Local IP address.
localhost will always goto 127.0.0.1 but I doubt

Related

i am having problems when i try access localhost wordpress site from mobile

i am designing my wordpress website in my localhost with using wampp 3.1.7 (apache 2.4.38) and i tried reach my project from mobile.
i read stackoverflow topics and applied steps one by one :
-added 8080 port in my firewall "incoming rules"
edited rooter NAT with my ip : 192.168.0.xx and port 8080
i changed apache httpd.conf like :
Listen 0.0.0.0:8080
Listen [::0]:8080
<Directory />
AllowOverride none
Require all granted
</Directory>
onlineoffline tag - don't remove
Require all granted
ServerName localhost:8080
and edited httpd-vhosts like :
# Virtual Hosts
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Everything work well localhost:8080/mysite or 192.168.1.xx/mysite work well too.wampp systemtry icon is glowing green with red dot. its online and working well too.
when i try enter 192.168.1.xx from my phone i am entering wamppserver settings.but if i add /mysite (192.168.1.xx) i had error localhost refused to connect. (err_connection_refused)
tried everything but didn't get the result.sorry for my bad language..
1 more question..how can i open that server everyone for share my website design with friends to get feedback its possible ?

Home Page Wordpress on Free MAMP does not work

I have installed MAMP (free version) on my Mac and I see the Start Page but I have a problem:
I deployed wordpress but browser say unable to connect (basically I cannot see wordpress page in browser).
In Document Root if I put a static html file I am able to see it in the browser. I am also able to see wordpress administrative pages and all other pages but home page. I have 8888 and 8889 for php and mysql ports. I do not know how to debug the issues. php, apache and mysql do not report any particular problems.
I configured virtual hosts following this guide:
http://foundationphp.com/tutorials/vhosts_mamp.php
The strange thing when I put http://localhost:8888/mywebsite in the browser it is redirected to localhost/mywebsite.
In /etc/hosts I have:
127.0.0.1 localhost
In httpd.conf I activated:
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
and in this file I have:
NameVirtualHost *:8888
<VirtualHost *:8888>
ServerAdmin myuser#gmail.com
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
ErrorLog "logs/mywebsite-error_log"
CustomLog "logs/mywebsite-access_log" common
</VirtualHost>
Hope someone could help.
I found the solution. After several debugging I found that this guide is correct: http://foundationphp.com/tutorials/vhosts_mamp.php
You need: 1. In /etc/hosts add your virtual hosts like:
127.0.0.1 localhost
127.0.0.1 mywebsite
before I only used localhost because I hoped to use this host in browser but I found it's required to define a new host like mywebsite.
In httpd.conf I activated:
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
In this file I have:
ServerAdmin myuser#gmail.com
DocumentRoot "/Applications/MAMP/htdocs"
ServerName mywebsite
ErrorLog "logs/mywebsite-error_log"
CustomLog "logs/mywebsite-access_log" common

ERR_NAME_NOT_RESOLVED on third level domain localhost for WPMU

I'm setting up WP Network on my localhost. I'm on windows, using Uniform Server, and I've setup a vhost like this:
<VirtualHost *:${AP_PORT}>
ServerAdmin webmaster#themes.wp
DocumentRoot ${US_ROOTF}/vhosts/themeswp
ServerName themes.wp
ServerAlias www.themes.wp *.themes.wp
ErrorLog logs/themes.wp-error.log
CustomLog logs/themes.wp-access.log common
<Directory "${HOME}\vhosts\themeswp">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
plus I've added this on the windows Host:
127.0.0.1 themes.wp
If I go to
themes.wp
everything loads fine. If I try a third level domain, like
dummy.themes.wp
I get
ERR_NAME_NOT_RESOLVED
Wordpress Network tells me this:
Warning! Wildcard DNS may not be configured correctly!
The installer attempted to contact a random hostname (9f3c9c.themes.wp) on your domain.
This resulted in an error message: cURL error 6: Could not resolve host: 9f3c9c.themes.wp
Right, themes.wp and dummy.themes.wp different domains
Fast way: add dummy.themes.wp to you hosts file
127.0.0.1 dummy.themes.wp
Or install any simple dns server because hosts not support wildcard domains

Accessing local Wordpress site within the network using WAMP?

Allright this driving me nuts! I have spent couple of hours trying to find a solution of how to access my Wordpress site from outside my network, when no easy solution was found I'm OK with just being able to accessing it from another device within my network. It turned out to be a tricky part as well. I just don't know how to configure this.
I run virtual hosts using WAMP likeso:
In httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "I:\web_dev\wordpress"
ServerAlias wordpress.local
ServerName wordpress.local
<Directory "I:\web_dev\wordpress">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require local
</Directory>
</VirtualHost>
My httpd.conf file is set to port 80:
ServerName localhost:80
Hostsfile:
127.0.0.1 wordpress.local
If I now want to access this from another computer or my mobile that are in my network, how do I achieve this?
Allow local traffic in httpd.conf, then use your actual IP as the WP URL.
In WAMP's httpd.conf file, I added the Allow from 192.168 line.
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168
Then in the WP General settings, I changed the Wordpress Address and Site Address to the site's actual IP. You can get this site's IP4 address via ipconfig in the command console.
Then you're done.
If you don't want people on your local network snooping around the rest of your WAMP setup, create a new .htaccess file in the servers root (the www folder) with this:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Then add this above whatever is in WP's default .htaccess
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168
You'll need to change your Listen directive to listen to the network IP or 0.0.0.0 rather than localhost if that is not yet done.
Then on the other computer edit the hosts (usually C:\windows\system32\drivers\etc\hosts or /etc/hosts) file to include the IP of the webserver computer mapped to wordpress.local
192.168.2.54 wordpress.local
Couple of good tutorials on getting these setup:
View MAMP Virtual Hosts On Your iPad and iPhone Over The Local
Network - BenjaminRojas.net http://goo.gl/6hM4Aa
How to access MAMP sites across a network - CodeBoxers
http://goo.gl/qCXMQK (scroll down to the xip.io portion)
"The solution is to create a local proxy server on the machine that has MAMP installed, and then configure the client to use that proxy to browse the web. The client configuration only takes a few seconds, and is easy to disable once you’re done." - Dalton Rooney (from the first link)

How to enable wordpress website locally on network and via localhost

My wordpress site works fine on my mac via localhost, using Xammp. I want to view the site on my iPhone. So I type in 192.168.0.2 and voila, it brings up my localhost directory. I then click on the site in question and the content is there but no styling or images. I realise that this is because the paths to all the resources is hardcoded into the wordpress database. So when I am accessing the url via 192.168.0.2/mywebsitename on my iPhone, it's looking for all the resources using a base url of localhost/mywebsitename. Localhost path doesn't exist on my iPhone, only 192.168.0.2 does.
So has anyone found a solution to this little issue? How can I see a wordpress installation by ip address and by localhost access?
For this exact issue, before developing a website. You must create a domain(VirtualHost in apache)
Add the following contents in the file httpd-vhosts.conf, make sure it is included in Apache Configuration. This line ( Include conf/extra/httpd-vhosts.conf ) should be present in httpd.conf
Contents of httpd-vhosts.conf:
NameVirtualHost 192.168.1.26:80
<VirtualHost 192.168.1.26:80>
<Directory "e:/program files/ampps/www/mywebsite">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName 192.168.1.26
ServerAlias 192.168.1.26
ScriptAlias /cgi-bin/ "e:/program files/ampps/www/mywebsite/cgi-bin/"
DocumentRoot "e:/program files/ampps/www/mywebsite"
ErrorLog "E:/Program Files/ampps/apache/logs/192.168.1.26.err"
CustomLog "E:/Program Files/ampps/apache/logs/192.168.1.26.log" combined
</VirtualHost>
(Change the path, ip, etc according to your need). Now after adding the contents. Restart Apache. Now when you access 192.168.1.26 (in my case) from other machine in your network or your same machine. You should see the contents of mywebsite folder directly(or contents index.php if it has any). Now install wordpress using the ip you specified(browser should have that ip in the address bar), in my case 192.168.1.26.
Well I use AMPPS to avoid this headache. It allows me to create domains locally. Also if I have bought a domain say mywebsite.com and i want to add a customized wordpress site on, I create a the domain in the AMPPS with the same name. So the URL of my live website and the local are same. :) Then I simply put the files directly on my server via FTP and obviously import the database on my server.
EDIT: BTW, AMPPS allows to install WordPress in a single click. It has simple interface where you can specify AMPPS to install the WordPress on the created Domain.

Resources