want to give access only to web app not to my local host page
Posted by: rajashani99 (39.50.54.---)
Date: August 17, 2016 06:22PM

hello
i am using wamp server 3.0.5
i have create virtual host of my web application which is perfectly working on my LAN but i want to give access to my users only for my web application not to my local host page
when they enter 192.168.10.11:81 they can access to my localhost page
i want to limit them to 192.168.10.11:81/pos/index.php

my httpd-vhosts.conf is like this


<VirtualHost *:81>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.10
</Directory>
</VirtualHost>


<VirtualHost *:81>
ServerName pos
DocumentRoot "c:/wamp/www/opensourcepos-2.4"
<Directory "c:/wamp/www/opensourcepos-2.4/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.10
</Directory>
</VirtualHost>

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: RiggsFolly (Moderator)
Date: August 17, 2016 07:40PM

Hi


So stop them getting to your WAMPServer home page, by not GIVING THEM THAT ACCESS

<VirtualHost *:81>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local

</Directory>
</VirtualHost>


<VirtualHost *:81>
ServerName pos
DocumentRoot "c:/wamp/www/opensourcepos-2.4"
<Directory "c:/wamp/www/opensourcepos-2.4/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.10
</Directory>
</VirtualHost>

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: rajashani99 (39.50.54.---)
Date: August 18, 2016 12:37PM

i already tried it but when i do like this it says

Forbidden
you don't have permission to access /opensourcepos-2.4/ on this server

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: RiggsFolly (Moderator)
Date: August 18, 2016 01:08PM

But does this stop people accessing the WAMPServer homepage?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: rajashani99 (39.50.54.---)
Date: August 18, 2016 01:48PM

yes this stop people accessing the WAMP Server homepage but as well as stop accessing my web application.

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: RiggsFolly (Moderator)
Date: August 18, 2016 02:19PM

Out of interest, why did you chnage the listening port to 81?

And do you have a local DNS server running where you are?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 08/18/2016 02:22PM by RiggsFolly.

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: rajashani99 (39.50.54.---)
Date: August 18, 2016 02:30PM

port 80 is used by my skype and as well as port 80 is blocked by my isp
no i am not not using DNS server
it is locally host on my computer

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: RiggsFolly (Moderator)
Date: August 18, 2016 02:37PM

Ok the reason for the problem when connecting from another PC is that for Apache to find your Virtual Host it need to see the name in the URL i.e. the ServerName `pos`

So if you are only accessing this from a couple of other PC's you can do this


On each PC that want access edit the HOSTS file on each of those PC's and add this to their hosts file

192.168.10.11 pos

and restart the dnscache service, or just reboot.

Now in the browser on the other PC's use the url `[pos]` and Apache will be able to match the server name and serve the correct site.

When it comes to accessing the site from the internet you are going to have to do a little more fiddling, but for now see if this works

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: RiggsFolly (Moderator)
Date: August 18, 2016 03:11PM

Another option would be to use another port number.

Amend the httpd-vhosts.conf and define your site like this


Listen 0.0.0.0:82
<VirtualHost *:82>
  ServerName pos
  DocumentRoot "c:/wamp/www/opensourcepos-2.4"
  <Directory "c:/wamp/www/opensourcepos-2.4/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
    Require ip 192.168.10
  </Directory>
</VirtualHost>

Then from any PC on your subnet you can use the url `[192.168.10.11]` to get to your site

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: want to give access only to web app not to my local host page
Posted by: rajashani99 (39.50.54.---)
Date: August 18, 2016 08:50PM

wow thank you very much RiggsFolly

my problem is solved by using second option

option one did not work it says

Forbidden
you don't have permission to access /pos on this server

but now i am happy my problem is solved

now i am using port 81 for my local host and port 82 is for my web application

you are great :-)

Options: ReplyQuote


Sorry, only registered users may post in this forum.