Apache local and LAN access settings

Source: Internet
Author: User

Apache local and LAN access settings

Recently done project needs colleague Ajax project to me, because it is a test environment, so I need to be able to access my server. My server directly uses the Wampserver. Because there is no contact, so Baidu a bit, are not successful, and later read the manual. And now I'm going to share it. . (Estimated knowledge is more old, after all, now use more nginx.) Company or IIS server--!)

Extranet access Settings

If the Vhosts module is not turned on, the general access directory refers to your www directory. httpd.conf inside you'll see a section like this

  1. <directory Path to your www>
  2. Configuration Items
  3. </Directory>
  4. Order deny allow
  5. Allow from all ....
  6. #第一个是设置访问权限的.
  7. Options Indexes FollowSymLinks
  8. #第二个是设置访问目录的时候, will not list the files therein
  9. Require Local or other
  10. #第三个设置的就是本地访问还是其他的ip的访问
Set up extranet access

After looking at the above configuration, you should be configured, and maybe after you Baidu
What Require all granted, what allow from all, but why not succeed?

The answer is really simple, that is, if you open the Vhosts module, your original
WWW (PS: It is said that the httpd.conf inside will fail), the reason is so simple, this is why you open the Vhosts module, and then configure a virtual host, and then localhost access, but can not access the reason, Knowing the reason for this is a simple solution.

    • Only use the WWW directory, then close the Vhosts module

    • Need to use the virtual host, then in the vhosts.conf to configure the external network access

See here you should be configured.

  1. #<virtualhost *:80>
  2. # documentroot "D:\soft\wamp\www"
  3. # ServerName 192.168.0.6
  4. # <directory "d:/soft/wamp/www/" >
  5. # Order Deny,allow
  6. # Allow from all
  7. # </Directory>
  8. #</virtualhost>

Just like that. If LAN access is required
Need require ******, specific self Baidu Bar

Apache local and LAN access settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.