Search Unity

Stuck while making my own DB accessible over WAN

Discussion in 'Multiplayer' started by Aeskyphaz, Apr 14, 2020.

  1. Aeskyphaz

    Aeskyphaz

    Joined:
    Jun 2, 2017
    Posts:
    52
    Hello,
    I'm afraid this may not be the right place to post this question, if so please say so and I will relocate this thread.
    That being said, I am in the journey of making my own connected game. Previously, I managed my database (login and such) with the help of a third-party service (000webhost). But due to the infuriating terms of use and overall poor experience I decided to give it a try and make my own, with my favourite sidekick the Raspberry Pi.
    So here I am, with my mini-web server all setup with Apache, php, mysql and a phpmyadmin panel, port 22 forwarded towards it to allow SSH, and populated with a placeholder users database.

    However, I have very limited knowledge about some networking concepts. What was easy about using 000webhost was that I could just host my database here, upload my php files, and call them through unity web requests for multiple things. For example, for login (grab password hash in db and see if it fits the login attempt), I would just send my request to https://********.000webhost.com/login.php. However, I cannot figure out how to "link" my php scripts and my database together this way in my own local server... My head hurts going through a myriad of solutions which did not seem to meet my needs, or they seemed just plain overkill for my little experiment.

    Sorry if this is kinda vague, but what do I have to look into so that my RasPi's databases and php scripts are accessible through WAN? Basically, partially replicating what 000webhost was doing ? I tried setting up a no-ip account, but I can't figure out how to point it at a local adress :/

    Thanks in advance :)

    (Note : I do understand the concept of port-forwarding; in fact I've already successfully done it both to SSH into my RasPi and to connect to a unity-made Game Server)
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You just need the database accessible from the local machine. The Apache server contacts the database locally, so that is all you need to configure the database for. The Apache server needs to be accessible from elsewhere.
     
  3. Aeskyphaz

    Aeskyphaz

    Joined:
    Jun 2, 2017
    Posts:
    52
    Thank you for your reply, and sorry for my late answer; I found out that, as you mentioned, this is implemented by default locally so I could solve my issue and get it to work !
    I'm in the process of writing a detailed step-by-step guide how I set it up in case someone else ever cares about setting up a home test server, then I'll mark the thread closed
     
    Joe-Censored likes this.