skip to Main Content

I have developed a website with a complete different virtual host in WAMP v 3.2.3 it’s running well on my local machine(localhost) but the problem lies with it’s access over the LAN.I have changed its apache httpd-vhosts.conf file from

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

#                     
<VirtualHost *:80>    //My required Virtual Host
    ServerName test
    DocumentRoot "c:/wamp64/www/project1/test/sites/">"
    <Directory  "c:/wamp64/www/project1/test/sites/">">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require Local
    </Directory>
</VirtualHost>

to:

 # Virtual Hosts
    #
    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>
    
    #                     
    <VirtualHost *:80>    //My required Virtual Host
        ServerName test
        DocumentRoot "c:/wamp64/www/project1/test/sites/">
        <Directory  "c:/wamp64/www/project1/test/sites/">
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
            Require all granted    //         <--change(Local to all granted)
                   
        </Directory>
    </VirtualHost>

and allowed incoming inbound connection from port 80

Still the problem persists and I cannot access my project from any other device.
It shows:

Forbidden
You don't have permission to access this resource
Apache/2.4.46 (Win64)PHP/7.3.21 Server at 192.168.43.*

Where’the problem?
Please help.

2

Answers


  1. you don’t need to hide your local IPv4 address 192.168.43.*, there are millions of devices around the world with same IPv4 address as you, people outside of your local network can not communicate with your local IP address just by knowing your IPv4 address, it is not possible.

    You appear to have multiple virtual hosts set up for port 80. You only need one for local hosting.

    Make sure that the firewall on your server computer is configured to let apache through.

    Put whatever files you want to server inside the ‘www’ folder on your server computer.

    Use the below config settings and restart apache so that the new config is loaded.

    Open a web browser on any device that is connected to the same local network as your server computer i.e. mobile phone connected by wifi to the same router as your server computer.

    Type in the server computer IPv4 address into the browser of your mobile phone, done…

     <VirtualHost *:80>
    
          DocumentRoot ${INSTALL_DIR}/www
    
          <Directory ${INSTALL_DIR}/www>
            Require all granted
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
          </Directory>
    
        </VirtualHost>
    
    Login or Signup to reply.
  2. # Virtual Hosts
    #
    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>
    

    To

    # Virtual Hosts
    #
    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        #Require local
        Require all granted
      </Directory>
    </VirtualHost>
    

    Next step: Open wamp file see this image

    find this section to changes see this image

    Require all denied
    

    To

    Require all granted
    

    Save and close. Restart all service your wampserver

    then paste your ipaddress in browser url see the result

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search