how to Connect two pc with single Wamp server - networking

Actually we are developing a new website in PHP . So is it possible to create a environment where we can share our works done .
in simple One wamp and two pc connected with lan is possible or not ? if it is how??

Within your VHOST definition there should be a <Directory ......</Directory> parameter
Inside that add
If you are using Apache 2.2.x
Allow from 192.168.1
If you are using Apache 2.4.x
Require ip 192.168.1
This will allow any ip address starting with 192.168.1 to connect to that VHOST
If you want to be specific and only allow certain ip's you can use this instead
Allow from 192.168.1.10 192.168.1.11
Or, if youare using Apache 2.4
Require ip 192.168.1.10 192.168.1.11
So your VHOST should look like this
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/countlead"
ServerName domain.com
ServerAlias www.domain.com
<Directory "C:/xampp/htdocs/countlead">
AllowOverride All
Require local
Require ip 192.168.2
</Directory>
</VirtualHost>

if run xampp or wamp (apache), and If Dmz (modem option) Forward packet to pc that wamp is run on it (LAN IP Address: exp:192.168.x.x) You Can Use His Remote Ip address To See (wamp/xampp) Root Directory .

Related

Cannot access wp admin on another computer in local network

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

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

Vagrant "domain forwarding"

Currently, I've got used to creating development domains like: projecttowork.dev.
Now I have a project, where I have to use subdomains as well, so like: module1.project.dev
I would like to start using Vagrant, because it looks awesome and I work together with some other people, and it would be great to have the same server everywhere.
In Vagrant, of course I can forward a port, like :8000 and get the server on virtual machine, but I can not figure out, how to "forward" a domain.
I tried different ways, but without any success.
Some details:
OS: Windows 8
Vagrant box: basic Ubuntu 12.04 LTS
Webserver on client: Nginx
Webserver on host: Apache (if needed)
How could I redirect this development domain to the virtual server?
-My settings in Vagrant file for network is:
config.vm.network "private_network", ip: "192.168.20.20" #choose you own
-In the host machine in /etc/hosts (linux) Windows/system32/driv.../hosts (windows)
192.168.20.20 domain.tld
-On the box check firewall (iptables - if the box is linux).
either deactivate your firewall on the box(I did this) or setup it to allow access from the host machine. (http://www.cyberciti.biz/tips/linux-iptables-examples.html)
-In the box set virtualhost for this domain (just an example):
<VirtualHost *:80>
ServerName domain.tld
DocumentRoot "/path"
RewriteEngine On
<Directory "/path">
Options Indexes FollowSymLinks
</Directory>
</VirtualHost>
Did you use etc/hosts file before to point dev domains to your dev machines IP? Same way, just add 1 row per subdomain to point them to you vagrant box IP, for example:
module1.project.dev 192.168.1.2
module2.project.dev 192.168.1.2
...

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)

Possible to setup some kind of custom home DNS to reroute URLs?

Basically what I run now on my home PC is one of these WAMP in a box applications so I can write my PHP code and use a MySQL database. That is all fine, but I run a lot of websites so now I have a folder I've called /~WEBSITES/ where I put everything making the URLs to these http://localhost/~WEBSITES/domain.com/ -- what I'd like is to be able to type http://local.domain.com/ into my address bar and have it point to my local drive, but I don't want this for everyone, just me.
Possible?
NOTE: I've running Windows XP
You'll need to setup virtual hosts with Apache, and combine that with HardCode's answer (setting your hosts file). That should do what you need.
AUTHOR EDIT: Great article, here's the quick notes on what to do (at least with the most recent version of apache2triad as your WAMP installer)
Add to C:\APACHE_INSTALL_DIRECTORY\conf\httpd.conf:
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
DocumentRoot "C:\apache2triad\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot "C:\apache2triad\htdocs\~WEBSITES\Domain1.com"
ServerName local.domain1.com
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot "C:\apache2triad\htdocs\~WEBSITES\Domain2.com"
ServerName local.domain2.com
</VirtualHost>
Add to C:\Windows\system32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 local.domain1.com
127.0.0.1 local.domain2.com
Modify the text file named "hosts" found in C:\Windows\system32\drivers\etc\
Suppose you want to point www.mycustomer.com to your local host. Add in:
127.0.0.1 www.mycustomer.com
You'll need to setup virtual hosts in apache (not IIS... oops), and combine that with HardCode's answer. That should do what you need.

Resources