Hey guys , i've got apache 2 installed with mysql and php 5, when typing the ip
of my computer into explorer or firefox or any computer on my network (its connected with a router) i can load up my website and read / write from the db, however no one can externally use the ip address for some reason...
I've enabled port forwarding to the comp with the server and it all works locally even on different computer, but for some reason not externally...??

Any ideas would be appreciated, thansk

actually i just got a brain wave, which ports should i be forwarding??
and also is it correct to have all the php files conencting to the server
localhost, root, password
?? or is it necessary to create a new mysql user

    Well, you should be forwarding port 80... or as an alternative you can just put that IP in the DMZ which will show your computer to the internet.

    It is suggested that you create a limited mySQL user account so that if someone hacks your computer, they can't totally screw you over. But it's not necessary if you're site is not going live. It's a judgement call on your part. Most people like to create a different user just to be safe.

    ~Brett

      Hey thanks for helping me out, I changed a few settings as you suggested and now when i try to access the ip via a computer not on my network, a message the page could not be displayed appears. I think a connection is actually being made with the comp, perhaps the mysql, or apache or php setting is somewhere not allowing it??

      strange thing is if i type in the ip on my comp or any other one on the network it works perfectly

        Is your ISP blocking traffic on TCP 80? They're pretty prone to do that y'know.....

          hey, your probably right, any ideas on how to get around that???

          is it right or wrong to have
          mysql_connect("localhost", "username", "pword");

          should localhost stay localhost or be changed to my ip perhaps???
          thanks for your reply

            I'm pretty sure localhost is fine, but have you tried using port 8080, it does the same thing as 80, just an alternative HTTP port

              Technically you can set up your own server using whatever port you want (4110, 3582, 8105, etc.). If you do that, you have to make sure to actually set up Apache to listen to that port number as well... otherwise the server won't respond....

              ~Brett

                ... and you have to tell all your friends/family/users/customers/etc to connect using that port ... something the non-geeks may not get at first glance....

                  hedgehead wrote:

                  hey, your probably right, any ideas on how to get around that???

                  is it right or wrong to have
                  mysql_connect("localhost", "username", "pword");

                  should localhost stay localhost or be changed to my ip perhaps???
                  thanks for your reply

                  You mean for an SQL server?

                  Localhost and only localhost ... unless the server is supposed to serve databases for other hosts as well. If this is just a personal/experimental/playtoy box, you don't want the SQL server listening. That's one more hole that I can exploit ....

                  Well, not me personally, but you get the idea?

                    Write a Reply...