Apache configuration multisite, Apache configuration site _php Tutorial

Source: Internet
Author: User
Tags browser cache multisite

Apache configuration multisite, Apache configuration site


In the httpd.conf file, the following configuration is available (note: The comment content of the httpd.conf file is removed)

Listen 80ServerName localhost
 
      allowoverride None    Require all Denieddocumentroot "E:"
 
  
   
      Options Indexes followsymlinks    allowoverride None    Require all granted
 
  



(It is best to clean up the browser cache before testing), then enter http://localhost/Workshop/Apache/in the browser to access all the files under E:/workshop/apache, note that the root directory here is e:, However, the above directory has permissions so that it cannot access all the contents of the E-drive, if the above directoy is changed to:


 
      Options Indexes followsymlinks    allowoverride None    Require all granted



Then you can access everything in the E-drive from the browser, when you enter localhost in the browser, the browser will display all the contents of the E-packing directory, and can be accessed. For the sake of security, we do not usually do so, so the usual Setup method is the following configuration:


Listen 80ServerName localhost
 
      allowoverride None    Require all Denieddocumentroot "e:/workshop/ Apache "
 
  
   
      Options Indexes followsymlinks    allowoverride None    Require all granted
 
  



The browser only allows access to a specific directory, which is all content in the E:/workshop/apache directory. Of course for the second dir, you can set access permissions for different folders under E:/workshop/apache.


Finally, for the settings of the virtual host, please follow the following format (placed at the end of the httpd.conf file):


As shown below, the listening port needs to be set first, followed by the Namevirtualhost specified host address and port, followed by VirtualHost settings, including Severname, which is the host name and the document root, note that for local development, Set servername to localhost or 127.0.0.1, where the document root directory is the same as the directory settings, or you can set different access permissions for different folders in the document root directory. The X number represents the virtual host that listens on all access settings ports.

Listen 81NameVirtualHost *:81
 
  
   
      ServerName 127.0.0.1    documentroot "c:/users/administrator/php/ Webroot1 "    
  
   
    
      Options Indexes followsymlinks   allowoverride None   Require all granted
  
   
 
   Listen 82namevirtualhostx:82
 
  
   
      ServerName 127.0.0.1    documentroot "c:/users/administrator/php/ Webroot2 "    
  
   
    
      Options Indexes followsymlinks   allowoverride None   Require all granted
  
   
 
  

http://www.bkjia.com/PHPjc/1004399.html www.bkjia.com true http://www.bkjia.com/PHPjc/1004399.html techarticle Apache Configuration Multi-site, Apache configuration site in the httpd.conf file, the following configuration (note: To remove the httpd.conf file comment content) Listen 80ServerName localhostdirectory/ Allowo ...

  • Related Article

    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.