Student
Student

Reputation: 452

How to set up www directory to public? WAMP

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 :

  1. My WAMP is orange.
  2. I have the MYSQL Community Edition in my PC.
  3. My WAMP version is 2.5
  4. Apache version is 2.4.9
  5. MySQL version is 5.6.17
  6. 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.

Upvotes: 0

Views: 2048

Answers (2)

Student
Student

Reputation: 452

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) :

  1. Obtain your private ip address (can be obtained from cmd by typing ipconfig)
  2. 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.
  3. In Apache httpd.conf file, edit the Listen to your port number that you have port forwarded. (Eg. Listen 80)
  4. 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.
  5. 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 : enter image description here

Upvotes: 0

NPC
NPC

Reputation: 869

Modify apache httpd.conf file

Listen 2727

Upvotes: 1

Related Questions