Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

why wamp server put online/ offline option is missing?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 wampinapacheapache{version}confextrahttpd-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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...