How to bring wamp server online?

后端 未结 3 926
生来不讨喜
生来不讨喜 2021-02-06 09:25

I have already tried port forwarding through router and also disabled my firewall. I also edited httpd.conf. There I changed

Listen 80

to

3条回答
  •  梦毁少年i
    2021-02-06 09:45

    It should have been a simple case of left clicking the WAMPManager menu and clicking Put online.

    What that would have done is changed this section of httpd.conf from this:

    If using Apache 2.2.x

    #   onlineoffline tag - don't remove
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1 ::1 localhost
    

    To this:

    #   onlineoffline tag - don't remove
        Order Allow,Deny
        Allow from all
    

    If using Apache 2.4.x

    #   onlineoffline tag - don't remove
        Require local
    

    To this:

    #   onlineoffline tag - don't remove
        Require all granted
    

    And strictly thats all you should have needed to do!

    But as you have done some manual messing with httpd.conf here are some things you need to check. I am assuming you wanted to change the port to 8080 rather than thinking you had to for some reason. If you didnt want to change port number to 8080 then use 80 in the following info instead of 8080. Changing to 8080 just makes life more complicated for your users, but if this is just a play site that does not really matter I suppose.

    httpd.conf

    # as your router probably does not support IPV6 change so apache only listens on IPV4
    # you dont need to put the actual ip address of this PC in here as you say you did.
    
    Listen 0.0.0.0:8080
    
    # ServerName port need to match the Listen, your question made me think you may have left this as localhost:80
    ServerName localhost:8080
    

    If using Apache 2.2.x

    # Assuming your site is in c:\wamp\www ( this section should already exist I just removed all the comments for brevity)
    
        Options Indexes FollowSymLinks
        AllowOverride all
    
        #
        # Controls who can get stuff from this server.
        #
    #   onlineoffline tag - don't remove
        Order Allow,Deny
        Allow from all
    
    

    If using Apache 2.4.x

    # Assuming your site is in c:\wamp\www ( this section should already exist I just removed all the comments for brevity)
    
        Options Indexes FollowSymLinks
        AllowOverride all
    
        #
        # Controls who can get stuff from this server.
        #
    #   onlineoffline tag - don't remove
        Require from all
    
    

    If you made the common mistake of changing this section, change it back to this, or you will be giving access to your C:\ to anybody.

    If using Apache 2.2.x

    
        Options FollowSymLinks
        AllowOverride None
        Order Deny,Allow
        Deny from all
    
    

    If using Apache 2.4.x

    
        Options FollowSymLinks
        Require all denied
    
    

    I hope something in here makes you stumble upon your mistake or ommission.

    EDIT: Additional info

    phpMyAdmin is protected from prying eyes like this:

    edit c:\wamp\alias\phpmyadmin.conf

    Alias /phpmyadmin "d:/wamp/apps/phpmyadmin3.5.1/"
    
    # to give access to phpmyadmin from outside
    # replace the lines
    #
    #        Order Deny,Allow
    #   Deny from all
    #   Allow from 127.0.0.1
    #
    # by
    #
    #        Order Allow,Deny
    #   Allow from all
    #
    
    
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
    
    

    See the line Allow from 127.0.0.1 that stops anyone not on the same PC as the database using it.

    So if you are trying to access that from the internet, it wont work.

    I suppose you could TEMPORARILY change it to :

    Order Allow,Deny
    Allow from all
    

    Or better still if you know the ip address of where you are going to test it from you coudl do

    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost
    Allow from xxx.yyy.zzz.aaa
    

    Where xxx.yyy.zzz.aaa is your friends IP address.

提交回复
热议问题