How to set up www directory to public? WAMP - mysql

I cant seem to find any good solution for my issue so I hope this question will be answered once and for all.
First, I understand that by hosting my html files online directly from my PC means to loosen up my PC security and that can be dangerous. But I am fine with this as this is just my testing laptop. Nothing important or whatsoever in here.
So lets start with the main issue. I have port forwarded the port 3306, 80, 8080, and 2727(which I plan to switch the apache port to this)
Tested port online and result is open.
In my apache httpd.conf file, here is what I have setup..
Listen 0.0.0.0:2727
ServerName xxx.xxx.x.xx:2727 (which is my private ip)
<Directory "c:/wamp/www/">
Options FollowSymLinks Indexes
Allow from all
Order Allow,Deny
AllowOverride All
Require all granted
</Directory>
I am now able to access my index.html in the wamp www directory by typing 127.0.0.1:2727 in the url (same goes to /phpmyadmin)
What should I do next to make sure my public ip can access the index.html?
Example, when I enter my public ip like this 175.162.154.18:2727, it just shows connection timed out.
Extra info if this helps :
My WAMP is orange.
I have the MYSQL Community Edition in my PC.
My WAMP version is 2.5
Apache version is 2.4.9
MySQL version is 5.6.17
Apache service test port 80 is not used.
I apologize in advance if my question seems difficult to understand but I will try my best to provide as much information as per request.

Modify apache httpd.conf file
Listen 2727

Basically WAMP and MySQL Community Edition does not work quite well together.
What I did was uninstall every program and files related to MySQL and WAMP. Restarted my PC and continue to delete existing folder related to both MySQL and WAMP.
Then, I installed a fresh WAMP again and it is finally green in color! Hooray!
So I head over to the httpd.conf file and edited Listen 80 since it is the default and my ISP is not blocking port 80 and ServerName 192.168.0.x:80 which is my Private IP address. I did not modify any other than this in the file and when I type my public ip by using my mobile data network, it connected successfully to my local website!
Conclusion to set-up your own website ONLINE on your PC (with WAMP) :
Obtain your private ip address (can be obtained from cmd by typing ipconfig)
Login to your router and port forward the port 80 (or another if your ISP is blocking port 80) under your PRIVATE ip address. Note : I port forwarded both TCP & UDP.
In Apache httpd.conf file, edit the Listen to your port number that you have port forwarded. (Eg. Listen 80)
Edit the ServerName below to ServerName xxx.xxx.xx.xx:80 where the ip is your private ip address. If you use a different port, change the 80 to your own port.
And basically that is it! Type your public ip in your browser url and done! Note: If you use another port you will need to type in your port number as well eg. 177.122.140.13:8080 (If port 8080 is what you chose)
Result :

Related

Caddy on LAN only

I am trying to setup a reverse proxy with Caddy, I also want to use subdomains to point to my different services, so I bought a domain but the domain can only point to an ip-address, and my routers ip-address is not static so to solve that I registered a subdomain on Duckdns and that subdomain is pointing to my routers ip-address all the time, the subdomains on that I payed for have DNS set to point to Duckdns and I have opened port 80 & 443 on my router to point to my server machine that is running Caddy, the caddyfile simply have the domains I payed for point to localhost services.
It works but only on LAN, outside it does not work
If your public IP address is not the same as nslookup mydomain.duckdns.org; the problem is DNS. check your dynamic DNS
client's configuration file for inaccuracies. Restart your router and trial that it works as expected
If the IP addresses match, but you cannot make access from outside the network, its a port forwarding issue. Check port forwarding rules on your router, and opened ports on your server.
sudo ufw status verbose and sudo ss -ltnp are helpful server commands.
If the IP addresses match, but you cannot make access from inside
the network, hairpin NAT is the issue. This is a router issue. Buy
a more feature complete router from your ISP, or setup a local DNS
server to resolve this minor annoyance.
[Using your phone, enable WiFi for 'inside' type testing; disable WiFi for 'outside' type testing].

Setting up MySQL database behind a VPN address

I have a regular MySQL server running with XAMPP at port 3306 and accessible by my internet ip aswell my local ip (127.0.0.1), the ports are forwarded in my router. An account set up to be accessed from any IP, Everything works fine.
I'm trying to make this same server be accessible by AirVPN DNS address. So I've followed AirVPN instructions to remove the forwarded ports in my router and forward a new port at their VPN with a random number (lets go with 1111) with local port as 3306 and DNS named as xxx.airdns.org
So I open MySQL with XAMPP under port 3306, nothing changed in config file. I run the AirVPN port checker over 1111 and it signals as open. I also try at other sites that checks ports and signals open at xxx.airdns.org:1111
Though when I try to make a connection as usual it returns error (10060): Can't connect to MySQL server on 'xxx.airdns.org' (10060)
Resolutions I've tried:
Switch port values in MySQL config files matching with the ports open in AirVPN
bound address to VPN adapter bind-address="10.6.114.48"
repeated the options above in all different kind of port combinations and addresses
Disabled Firewall on Ethernet adapter of VPN as described here
I couldn't achieve success in this task. I'm looking for some enlightment so I can understand the process.
EDIT:
The connection is set only to TCP protocol. A port check done through airVPN and is registered at XAMPP & FIREWALL logs as accepted connections. Though trying to connect from a client I got no log from Xampp or Firewall, it gets timed out.
Sorry for "answer" type not just comment, but i dont have enough reputation here :)
Maybe the protocol ( TCP/UDP ) is your issue.
If you use UDP on your airVPN better check forwarding on your router - most of them
by default sets TCP only. Otherwise maybe change to TCP on your airVPN.
ISP provider often filter this protocol.
Issue: Consider that you can't connect to a service running "behind" some VPN server from a machine that's connected to that very same VPN service.
Solution: Connect from another machine to test your service properly.

People on an other network can't connect to my WAMP server

I'm trying to host a WAMP server (WAMP version 3.0.6 on windows 10) and http:'//localhost, my internal IP and external IP (I forwarded port 80) are working. I Also registered a free .tk domain that's working on my network. But on other WiFi networks people can't connect to my server using my external IP or my domain.
I tested it on my smartphone (using mobile data to simulate the other WiFi network) and I got the error [My server's IP] took too long to respond.
How can I fix this?
In this case you have to make sure that the router is firstly directing to your server machine(local IPs generally have the form 192.168.x.x) and to the correct port ,so if WAMP's Apache is running on port 80 router must redirect to your machine's 80 port.
I've fixed it.
I double checked my port forwarding settings and changed the external IP from port 80. Then I saw a text: "When the External IP address is 0.0.0.0 you can access this port forwarding on internet, if you set a specific External IP address here the access is limited to only this IP address on internet", so I changed my external IP to 0.0.0.0 and now it's working!

Apache2 Linux GoDaddy

Hi I'm new to website development and I am trying to configure a number of websites from my home based server using Apache2 and Linux Mint.
I have setup three new websites in addition to the 000-default page.I have created the Virtual Host config files in sites-available and have added the sites to Host.conf. Internally(on the server in a browser) they are all working fine - I can access all four sites using localhost or the URLs I've configured them with -tested with and without the www. prefix and all seems fine. The four sites are just basic HTML scripts with different headers and different one line body.
I've added Listen 8090 to Listen 80 on my ports.conf file and have opened port 80 and 8090 on my firewall and have updated Port Forwarding on my router and tested they are open using PortCheckTool. The two ports are open and every other port is locked out so that seems good too.
I've tried to configure a GoDaddy domain name to direct activity to one of these sites. The domain name that works internally (on the server in a browser) is the same as my GoDaddy domain name I've bought. I've been into my GoDaddy account and pointed this domain at my external IP address (tried also adding port to forwarding 8090 as well as leaving port number as default). However when I access this domain from my mobile phone using 3G with WIFI turned off I just get sent to the 000-default homepage.Same using default Port 80 and with Port Forwarding to 8090. I have script for both 80 and 8090 in my site config files in sites-available directory.
So the connection is getting to the server, ports are OK, it's just that apache2 doesn't redirect the GoDaddy traffic but redirects fine locally on the server for the same site!?
Any ideas what I am missing?
Any help would be much appreciated.
Thanks.

Manage mySQL DB by using phpMyAdmin and point browser to ip

Hi I am completely new to phpMyAdmin and mySQL
Is there any way to configure remote management/access of my MySQL database by pointing requests or a browser to an IP? I have my server set up behind a router and have setup port forwarding for ports 8080 (tomcat) and 3306(should be default mySQL). Everything works locally on the machine, however I cannot access the dbs or phpmyadmin by pointing a browser from a computer on the local network to http://IP/phpmyadmin or from externally by pointing the browser to the IP given to me by my ISP. Any thoughts? Is there a specific way to edit the config files in order to allow the use of IP addresses?
Exposing your db and appserver on the internet is not a good idea. If these need to be accessed remotely, use a VPN or authenticated SSL. In the case of phpmyadmin - if this is running on a webserver on your network then you'll need to forward port 80 too - although I'd recommend using HTTPS/SSL (port 443)