CodeIgniter Forums
Use wamp localhost in other device - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Use wamp localhost in other device (/showthread.php?tid=69325)



Use wamp localhost in other device - omid_student - 11-05-2017

Hello
I cannot access to localhost(wamp) in my mobile
I try add ip to apache but i cannot use it
I search in google and find many topic about this problem but they are not helpful


RE: Use wamp localhost in other device - jreklund - 11-05-2017

If you by wamp mean WampServer 3.0 or later, you activate the "online" feature this way:
1. Left-click => Apache => httpd-vhost.conf
2. Add "Require ip 192.168.0" or whatever your ip-range are to your virtualhost for CI. 

This example are for the document root (not recommended). You should have a virtualhost for CI and have your mobile access the ServerName instead.
Code:
<VirtualHost *:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot c:/wamp/www
    <Directory  "c:/wamp/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
        Require ip 192.168.0 #This is your ip-range
    </Directory>
</VirtualHost>



RE: Use wamp localhost in other device - omid_student - 11-07-2017

(11-05-2017, 12:28 PM)jreklund Wrote: If you by wamp mean WampServer 3.0 or later, you activate the "online" feature this way:
1. Left-click => Apache => httpd-vhost.conf
2. Add "Require ip 192.168.0" or whatever your ip-range are to your virtualhost for CI. 

This example are for the document root (not recommended). You should have a virtualhost for CI and have your mobile access the ServerName instead.
Code:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory  "c:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.0 #This is your ip-range
</Directory>
</VirtualHost>

Thanks


RE: Use wamp localhost in other device - Narf - 11-07-2017

Do you know what "localhost" means?


RE: Use wamp localhost in other device - omid_student - 11-07-2017

(11-07-2017, 08:54 AM)Narf Wrote: Do you know what "localhost" means?

Yes my home is localhost Confused


RE: Use wamp localhost in other device - Narf - 11-08-2017

(11-07-2017, 11:53 AM)omid_student Wrote:
(11-07-2017, 08:54 AM)Narf Wrote: Do you know what "localhost" means?

Yes my home is localhost  Confused

Yes, your home is localhost. But so is any office PC, smartphone and literally every network-capable computer device on the planet.

localhost means "this computer" and can only be accessed by itself. If you try to access "localhost" on your smartphone, it will access the smartphone, so of course it won't get to your PC.