In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to configure multi-domain name or multi-port mapping for Apache under CentOS system". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to configure multi-domain name or multi-port mapping for Apache under CentOS system" can help you solve the problem.
Premise
The default apache website root directory under centos is / var/www/html. If I save a ci project in the html folder by default, and the server's public network ip is exampleip, because the mvc framework is used, apache needs to turn on the redirect function.
The method is as follows
The / etc/httpd/conf/httpd.conf file is configured as follows:
Documentroot "/ var/www/html/ci" options followsymlinks allowoverride all## possible values for the options directive are "none", "all", # or any combination of:# indexes includes followsymlinks symlinksifownermatch execcgi multiviews## note that "multiviews" must be named * explicitly*-"options all" # doesn't give it to you.## the options directive is both complicated and important. Please see# http://httpd.apache.org/docs/2.2/mod/core.html#options# for more information.# options indexes followsymlinks## allowoverride controls what directives may be placed in .htaccess files.# it can be "all", "none", or any combination of the keywords:# options fileinfo authconfig limit# allowoverride all## controls who can get stuff from this server.# order allow,deny allow from all
After configuration, restart apache using "service httpd restart", then type http://exampleip, in the browser and map it directly to the / var/www/html/ci folder.
1. Configure multi-domain name mapping. Suppose you need to map the domain names www.website1.com and www.website1.com, and add them at the end of the document httpd.conf
Namevirtualhost *: 80documentroot / var/www/html/website1servername http://www.website1.com options indexes followsymlinksallowoverride allorder allow,denyallow from alldocumentroot / var/www/html/website1servername http://website1.com options indexes followsymlinksallowoverride allorder allow,denyallow from alldocumentroot / var/www/html/website2servername http://www.website2.com options indexes followsymlinksallowoverride allorder allow,denyallow from alldocumentroot / var/www/html/website2servername http://website2.com options indexes followsymlinksallowoverride allorder allow,denyallow from all
Website1 and website2 are the project catalogue. Restart apache using "service httpd restart" after configuration
2. Configure multi-port mapping.
2.2.First, you need to listen to the port. Add the port under listen 80 of the document httpd.conf, such as 8080.
Listen 80listen 8080
2.2. Add the port mapping function at the end of the document
Documentroot / var/www/html/website3 servername exampleip:8080 options indexes followsymlinks allowoverride all order allow,deny allow from all
Website3 is the project catalogue. Restart apache using "service httpd restart" after configuration
This is the end of the content about "how to configure multi-domain name or multi-port mapping for Apache under CentOS system". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.