How to access/connect to Localhost(PHP developers)

Brief :

Developers develop everything(Sites/applications) locally, which further as per the standard protocol of the industry is been uploaded on dev/stage server for the QA to perform testing.

However, there are times when we want to test/share a particular site/app with another user using mobile or computer in the same network, this can be achieved by sharing our IP address or host name with others which will grant them the access to our web server.


Below are the steps to perform this operation.

Note : WAMP Server is designed to be a single seat developers tool. Apache is therefore configure by default to only allow access from the PC running the server i.e. localhost or 127.0.0.1 or ::1. When you want apache to accept connections from any ip address in the network, there are set of rules that you need to follow.1. Change the Apache Access Security Manual.(Edit config.httpd)

   * You can access the config.httpd file by left clicking wampmanager icon(In the taskbar) -> Apache -> httpd.conf.

   * This will launch the httpf.conf file in notepad(Or notepad++)

   * Once open look for the section of the file given below
                                         
                        <Directory "Path of your Host file/project">
                                   #
                                    # Possible values for the Options directive are "None", "All",
                                   # or any combination of:
                                   #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
                                   #
                                   # Note that "MultiViews" must be named *explicitly* --- "Options All"
                                   # doesn't give it to you.
                                   #
                                   # The Options directive is both complicated and important.  Please see
                                   # http://httpd.apache.org/docs/2.4/mod/core.html#options
                                   # for more information.
                                   #
                                   Options Indexes FollowSymLinks
                                   #
                                   # AllowOverride controls what directives may be placed in .htaccess files.
                                   # It can be "All", "None", or any combination of the keywords:
                                   #   AllowOverride FileInfo AuthConfig Limit
                                   #
                                   AllowOverride All
                                   #
                                   # Controls who can get stuff from this server.
                                   #
                                    # Require all granted
                                   # onlineoffline tag - don't remove
                                    Order Deny,Allow
                                    Deny from all
                                    Allow from 127.0.0.1
                                    Allow from ::1
                                    Allow from localhost
                        </Directory>

            * If you want to give access for a perticular ip address in the network, then in that case you will need to add an extra line after "Allow from localhost" giving specific permission to

            that ip. For Example, you can give the permission by writing "Allow from 192.168.20.19".

            * If you want to give access to all the ip addresses in the network, simple edit "Allow from Localhost" to "Allow from All".

2. Setting the Inbound Port Rule.

            * This is the crutial step in acheiving the process.

            * You have to first check the inbound port rule for your Apache HTTP Server in the Windows FireWall Settings.

            * Open Control Panel >> System and Security >> Windows Firewall then click on “Advance Setting” and then select “Inbound Rules” from the left panel and then search for "Apache HTTP Server"

            * Once selected right click on the rule >> Select properties >> Protocols and Ports, check for the port. (By default its always 80)

            * If the desired 80 port is not there in the rule, in that case you will have to write a new rule to open port (80) which can be achieved by >> Open Control Panel >> System and Security >> Windows Firewall then click on “Advance Setting” and then select “Inbound Rules” from the left panel and then click on “Add Rule…”. Select “PORT” as an option from the list and then in the next screen select “TCP” protocol and enter port number “80” under “Specific local port” then click on the ”Next” button and select “Allow the Connection” and then give the general name and description to this port and click Done.

            * Once done your PORT is open.   
        
3. Restart all the services of WAMP

            * You can restart your WAMP by left clicking wampmanager icon and "Restart all Services"

If all the above steps are followed successfully, you are good to go!

Podcast

Michael Patterson sat down with the CEO of Boston Byte, Mustapha Shaikh to discuss the significance and rapid digitization of the healthcar...