首页>>帮助中心>>美国服务器apache 多端口配置及网站指向非apache默认的网站文件夹设置方法

美国服务器apache 多端口配置及网站指向非apache默认的网站文件夹设置方法

2024/12/17 26次

美国服务器apache 多端口配置及网站指向非apache默认的网站文件夹设置方法
首先我们需要开启 Virtual hosts,进入Apache2.2conf目录下的httpd.conf文件,用搜索查找 Virtual hosts,并且将
Include conf/extra/httpd-vhosts.conf前个“#"删除保存。

在Apache的配置文件httpd-vhosts.conf下进行操作,位置在Apache安装目录下的Apache2.2confextra文件中。如图

用文本文档打开httpd-vhosts.conf文件
添加如下红色部分,默认情况下只有80端口。下面代码中每个颜色对应的响应对口的设置和目录。 # # Virtual Hosts # # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesnt need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # # for further details before you try to setup virtual hosts. # # You may use the command line option -S to verify your virtual host # configuration. # # Use name-based virtual hosting. #
NameVirtualHost *:80 NameVirtualHost *:81 NameVirtualHost *:82 NameVirtualHost *:83 NameVirtualHost *:84 NameVirtualHost *:85 NameVirtualHost *:86
NameVirtualHost *:88 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any block. # ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www/www-nongye ServerName www.landui.com ErrorLog D:/AppServ/www/www-nongye/errornongye.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common Options FollowSymLinks #Deny from all Allow from all ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www-chinaec ServerName www.landui.com DirectoryIndex index.php index.html ErrorLog D:/AppServ/www-chinaec/errornongjiale.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www/www-05110 ServerName www.landui.com ErrorLog D:/AppServ/www/www-05110/errornong05110.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www/wordpress ServerName www.landui.com ErrorLog D:/AppServ/www/wordpress/errornongwordpress.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www/magento ServerName www.landui.com ErrorLog D:/AppServ/www/magento/errormagento.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www/magento1322 ServerName www.landui.com ErrorLog D:/AppServ/www/magento1322/errormagento1322.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common ServerAdmin jsw7001@hotmail.com DocumentRoot D:/AppServ/www/www-nongjiale ServerName www.landui.com ErrorLog D:/AppServ/www/www-nongjiale/errornongjiale.log CustomLog logs/dummy-host2.appservnetwork.com-access_log common ServerAdmin webmaster@dummy-host2.x DocumentRoot "C:/Apache2.2/docs/dummy-host2.x" ServerName dummy-host2.x ErrorLog "logs/dummy-host2.x-error.log" CustomLog "logs/dummy-host2.x-access.log" common

这样保存后,就完成我们不同端口的建设。



购买使用一诺网络美国服务器,可以极大降低初创企业、中小企业以及个人开发者等用户群体的整体IT使用成本,无需亲自搭建基础设施、简化了运维和管理的日常工作量,使用户能够更专注于自身的业务发展和创新。美国服务器低至49元/月,购买链接:https://www.enuoidc.com/vpszq.html?typeid=3