Apache is one of the most popular HTTP server software, it is known for being fast, reliable (stable), and with a simple API extension, the Perl/Python interpreter can be compiled into the server, completely free, and source The code is all open. If you have your own server or VPS and don't want to buy expensive control panels for convenience, then configuring your own Apache is a compulsory course. The following is a brief introduction to how to bind multiple domain names and their associated second-level domain names by setting Apache's http.conf file (assuming that the domain names we want to bind are 45it.com and 45it.com, the second-level domain name is Blog.45it.com, independent IP is 72.167.11.30).
How to bind multiple domain names to apache Open http.conf 1, ServerName 127.0.0.1 Modified to ServerName 72.167.11.30 2, #NameVirtualHost * Modified into "NameVirtualHost 72.167.11.30" 3, there is a virtual host format at the end of the file, #<VirtualHost *> # ServerAdmin [email][email protected][/email] # DocumentRoot /www/httpd/html/45it .com # ServerName 45it.com # ErrorLog logs/45it.com-error_log # CustomLog logs/45it.com-access_log common #</VirtualHost> Simply add: <VirtualHost 72.167.11.30> DocumentRoot usr/local/www /ServerName 72.167.11.30 </VirtualHost> <VirtualHost 72.167.11.30> DocumentRoot usr/local/www/45it.com/ServerName 45it.com </VirtualHost> <VirtualHost 72.167.11.30> D ocumentRoot usr/local/www/45it.com/ServerName 45it.com </VirtualHost>
Log files can also be added according to their own path.
How Apache adds second-level domain name
httpd.conf needs to open mod_rewrite function (for specific instructions on URL redirection, you can refer to the .htaccess usage method summary), the specific operation is, in httpd At the end of the .conf, add the following:
RewriteEngine on RewriteMap lowercase int:tolower RewriteMap vhost txt:/usr/local/etc/apache/vhost.map RewriteCond ${lowercase:%{SERVER_NAME}} ^( .+)$ RewriteCond ${vhost:%1} ^(/.*)$ RewriteRule ^/(.*)$ %1/$1
where /usr/local/etc/apache is yours The path of the apache server configuration file is changed according to the actual situation (for example, under /etc/httpd/). Then, create a file in the directory of the path: vhost.map, the content is:
www.45it.com /usr/local/www/45it.com www.45it.com /usr/local /www/45it.com blog.45it.com /usr/local/www/45it.com/blog
Finally, in the root directory of the website /usr/local/www/, create the corresponding directory. . If you need to add, modify or delete the domain name, subdomain, just change the vhost.map file without restarting the apache process.
First, Putty introduction Putty is a remote login tool, it can be very convenient to log in to the
Use the group policy to restrict the permission of the executable exe of the website directory, whic
This article mainly describes the IIS not found provider The program may not be installed correctly
Before, the black station was a lot darker, but I didnt think about whether it would be traced. I di
Detailed explanation: Ten processor parameters of server processor products
When setting Windows 2003 to shut down or restart, the prompt box
Serv-U8.0 adds the skills of anonymous users
Ten rules to kill IIS server performance
Does the server operating system choose Windows or Linux?
IIS7 date display format solution
Ubuntu step by step ftp server graphic explanation
Finding application pool pid through iisapp command to solve IIS CPU usage is too high.
Configure the WSUS server client computer for automatic update
ISA has a "routing (chain) failure" problem prompt solution
Win7 system custom desktop theme method
WinXP desktop icon shows how to remove blue shadows
How does Win7 use the own drawing board to crop the picture?
How to add IPX protocol in Win7 system?
WinXP Msconfig.exe file missing solution
Change method of XP boot screen "Welcome"
Win10 annual update store "application" classification garbled solution