23

I'm using windows 8. recently i've installed wampserver3_x86_apache2.4.17_mysql5.7.9_php5.6.15. but the put online/offlline option is missing. I did wamp manager->wamp settings->menus item online/offline. it doesn't work also. there is no green the green mark beside this option.

What to do?

Dipen Panchasara
  • 13,480
  • 5
  • 47
  • 57

2 Answers2

52

Its not missing it is now an optional menu

Right click Wampmanager -> WAMPSetting -> Menu Item: Online/Offline

If you click it so there is a Tick beside it, you will see the Online/Offline menu on the left click menu.

However it was made optional as its use is defunct.

You should create Virtual Hosts for each of your projects, then you can amend each of those individually to control the Apache access rules.

In fact in WAMPServer 3 or greater, there is a Virtual Host defined for localhost so this old Online/Offline process wont actually do what you want.

You now have to go to the wamp\bin\apache\apache{version}\conf\extra\httpd-vhosts.conf file and manually amend that entry

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted                  #<-- changed line
    </Directory>
</VirtualHost>

This file can be edited using the wampmanager menus like this

wampmanager -> Apache -> httpd-vhosts.conf

However it is not recommended to allow this sort of access to localhost. It is better to create a Virtual Hosts for each of your projects eg

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName project1.dev
    DocumentRoot D:/wamp/www/project1
    <Directory  "D:/wamp/www/project1">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • So when is it online and when offline? Is it online when there is a check mark visible next to Online/Offline? Or is it the other way around? – Jo Smo Aug 22 '16 at 09:19
  • @JoSmo See amended answer – RiggsFolly Aug 22 '16 at 11:12
  • Thank you, it works but it's not very safety. Is there a way to grant access only for a specific IP or network ? For example, when we ask someone to test the project ? – Eve Oct 06 '22 at 09:20
  • 1
    @Eve Yes, use `require ip 192.168.0` for example to allow anyone in that subnet OR `require ip 111.222.333.444, 111.222.333.445` for specific ips – RiggsFolly Oct 06 '22 at 09:23
0

Hello you should solve the problem within C:\xampp\apache\conf\httpd.conf or wampserver or anything else.

You have 4 options, open only one option below. It will works. Find below section

in C:\xampp\apache\conf\httpd.conf

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
    Options Indexes FollowSymLinks Includes ExecCGI

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    
    AllowOverride All

    # Controls who can get stuff from this server.
    

    #Require all granted # put online
    #Deny from all
    #Require ip 192.168.1
    #Require ip 127.0.0.1
    Require local # put offline
</Directory>
Hakan
  • 240
  • 3
  • 4