Modify the main configuration file /usr/local/apache2/conf /httpd.conf. Open the main configuration file httpd.conf with the editor (vi, etc.), and uncomment the comment in front of the Include conf/extra/httpd-vhosts.conf line (about 395 lines) to make the include function take effect. Then add the listener "Listen 192.168.27.201:8088" to the virtual machine in the main configuration file (the first letter 'L' is uppercase). Modify the added content as follows:
Listen 192.168.27.201:8088.............. (omit some, no need to modify) Include conf/extra/httpd -vhosts.conf //Virtual machine configuration with a separate file, //This way the main configuration file is smaller, easier to maintain.Modify the virtual machine configuration file. Its directory is in the main configuration file httpd.conf in the way it is included (Include) indicates that the path is /usr/local/apache2/conf/extra/httpd-vhosts.conf. If you plan to use other files, you can configure it in the main configuration. Reassign in the file. This virtual machine configuration file is a template, giving examples of two apache virtual machines, commenting them out! Note: If it is a domain-based virtual machine mechanism, the NameVirtualHost *.80 line is required, because I am here based on the virtual mechanism of the port (exactly based on the IP address), so comment it out. First add the following block to httpd-vhosts.conf according to the template:
< VIRTUALHOST 192.168.27.201:8088>DocumentRoot "/www/docs" //Virtual Machine Root document directory ServerName 192.168.27.201:8088< /VIRTUALHOST>Then go back to the apache installation directory and execute the command bin/apachectl –t to check whether the syntax of the main configuration file is correct. Then execute bin/apachectl –S without errors. Check that the syntax of the virtual machine is correct. Next, create a test document test.html in the root document directory of the virtual machine, start the apache service bin/apachectl start&, use the browser to access http://192.168.27.201, and display the default page of apache, indicating that the main configuration file is normal. Go to http://192.168.27.201:8088/test.html. Return code 403 (no access), the content of the page is "You can't view this page...", the same problem has already happened to 2 people, they All agree that it was set up in the old version such as apache1.3, it should not be like this! And the grammar check has passed, what is the problem? Open the main configuration file conf/httpd.conf and find the following block:
< DIRECTORY />Options FollowSymLinksAllowOverride NoneOrder deny,allow //Deny Deny from first reject All //Reject all accesses < /DIRECTORY>This block is the access control of the directory, and it is very strict, so we must manually join the permission control block of the virtual machine directory. Allows users to access the virtual machine's directory and page files normally. There are two places to join the virtual directory access control block: the main configuration file httpd.conf and the virtual machine configuration file httpd-vhost.conf, which is more appropriate in that place? Of course, the most important reason for choosing a virtual machine configuration file is that it is more convenient to maintain and may also involve security issues (this I did not test). Next, insert the directory access control block into the virtual machine configuration file in the following form:
< VIRTUALHOST 192.168.27.201:8088>DocumentRoot "/www/docs" ServerName 192.168.27.201:8088< DIRECTORY docs? www ?> //Insert Starts Options -Indexes FollowSymLinksAllowOverride NoneOrder allow,denyAllow from all< /DIRECTORY> //Insert Ends< /VIRTUALHOST>Complete File, check the syntax, restart the apache service, and then use the browser to access the virtual machine address, this should be normal.
In the previous section we introduced how to install Windows 2000 Se
Today, the ASP program was deployed to iis7, and an error occurred on the server
Todays servers pseudo-static life and death cant be loaded, and many reasons cant
First, the advantages of domain renaming tools A new feature, you mu
Windows Server: Cut off the default shared channel seven strokes
The permissions set in the directory are not enough to cause the website to not post properly.
TCP/IP filtering open and close methods
Two major problems that lead to low cooling efficiency in the engine room
15 Tips for Protecting (IIS) Web Servers
Three minutes to ensure the security of IIS itself
Realizing Urlrewrite with Asp.net on Virtual Host
How does the Apache server traverse the proxy server? The environment of the
How to add mime type to support all suffix files in iis 7
Server Security Settings Tutorial: Hard Disk Permission Settings
How to write a virus with Visual Basic
Batch modify file suffix name skills under Win7, Win8, Win10
Win7 power off restarts the solution to protectsrv.sys blue screen error
How to prohibit the same label merge in win7 Ultimate computer?
Windows XP installation parameters reveal big
Windows7 Ultimate system can not use the two solutions under the clipboard
Win7 quick start bar is gone, how to do
Easily create a virtual hard disk in Windows 7
How to backup and restore Win7 system backup image of Windows7 system