Search code examples
web-serviceswamp

Make available online a localhost web application


I have built a basic web application using html, css and php (it is a library with query, modify etc. capabilities). I have built the databases containing the books information, subscribers information etc. with phpMyAdmin from Wamp server. On localhost (C:\wamp\www) everything works ok (I can add, modify, make queries etc.).

Now I would like to make this web application available online, but I have no idea how this can be done. The access to the database must be also available online (for search, queries etc. from the databases).

Can somebody support me?


Solution

  • The access to your database can be local since the php files that use yourdatabase run in the same machine.

    You only need to accept online access to your apache server, if it's not accessible yet, and have no firewall active. In this case you should be able to connect to your server by ip. And you'll need a domain and a dns server if you want not having to write the public IP to connect.

    You need a public IP address or routing the outside web traffic to your own web server. Most routers have an advanced section called IP/Port Forwarding: find yours. If you don’t have this, I’m afraid you cannot be reachable by the outside.

    Besides that, find your private IP with:

    C:\>ipconfig
    

    take note of the IP address: that’s your private address, which uniquely identifies you in your local network. 

    In httpd.conf change:

    ServerName localhost:80
    

    With:

    ServerName <private IP>:80
    

    Also find this line:

    Require local
    

    And change it to:

    Require all granted
    

    Restart your web server. Find out what’s your current public IP address (the public address of your router: https://www.whatismyip.com ) and visit:

    http://<public IP>:<port>/
    

    Or, in case you have not changed the default http port (80) just visit:

    http://<public IP>/