httpd.confphp
#監聽端口設置 Listen 80 Listen 12.34.56.78:88 #打開http代理模塊 LoadModule proxy_http_module modules/mod_proxy_http.so #主機郵箱設置 ServerAdmin postmaster@localhost #監聽服務設置 ServerName localhost #監聽別名設置 ServerAlias localhost-alias #打開代理轉發 ProxyPreserveHost On #jsp項目轉發8080端口 ProxyPass /jsp/ http://localhost:8080/jsp/ ProxyPassReverse /jsp/ http://localhost:8080/jsp/ #asp項目轉發8888端口 ProxyPass /asp/ http://localhost:8888/asp/ ProxyPassReverse /asp/ http://localhost:8888/asp/ #路徑權限設置(所有拒絕) <Directory /> AllowOverride none Require all denied </Directory> #項目目錄設置 DocumentRoot "D:/www/php" #項目目錄權限(所有容許) <Directory "D:/www/php"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted </Directory> #索引文件設置 <IfModule dir_module> DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \ default.php default.pl default.cgi default.asp default.shtml default.html default.htm \ home.php home.pl home.cgi home.asp home.shtml home.html home.htm </IfModule> #禁用權限文件訪問 <Files ".ht*"> Require all denied </Files> #虛擬目錄設置 <IfModule alias_module> #虛擬目錄設置(CGI方式) ScriptAlias /cgi-bin/ "D:/www/cgi-bin/" #虛擬目錄設置(普通方式) Alias /bin/ "D:/www/bin/" </IfModule> #虛擬主機設置 NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@example.com DocumentRoot "D:/www/example" ServerName example.com ServerAlias www.example.com ErrorLog "logs/example.com-error.log" CustomLog "logs/example.com-access.log" common ProxyPreserveHost On #jsp項目轉發8080端口 ProxyPass /jsp/ http://localhost:8080/jsp/ ProxyPassReverse /jsp/ http://localhost:8080/jsp/ #asp項目轉發8888端口 ProxyPass /asp/ http://localhost:8888/asp/ ProxyPassReverse /asp/ http://localhost:8888/asp/ </VirtualHost> #項目目錄權限(所有容許) <Directory "D:/www/example"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted </Directory>
xampp.confhtml
#如下代碼爲xampp權限控制,一下項目只能在本機訪問 <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> Require local ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </LocationMatch>
無,直接將項目放入指定路徑便可web
server.xmlapache
<?xml version='1.0' encoding='utf-8'?> <Server port="8005" shutdown="SHUTDOWN"> <Service name="Catalina"> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Catalina" defaultHost="localhost"> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
1.使用壓縮版的tomcat不能使用安裝版的。
2.第一個tomcat的配置不變。
3.增長環境變量CATALINA_HOME2,值爲新的tomcat的地址;增長環境變量CATALINA_BASE2,值爲新的tomcat的地址。
4.修改新的tomcat中的startup.bat,把其中的CATALINA_HOME改成CATALINA_HOME2。
5.修改新的tomcat中的catalina.bat,把其中的CATALINA_HOME改成CATALINA_HOME2,CATALINA_BASE改成CATALINA_BASE2。
6.修改conf/server.xml文件:
6.1 <Server port="8005" shutdown="SHUTDOWN">把端口改成沒有是使用的端口。
6.2 <Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" /> 把端口改成沒有是使用的端口。
6.3<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" /> 把端口改成沒有是使用的端口。 tomcat
配置iis服務器監聽8888端口,並將路徑設置爲d:\www\asp便可,具體步驟可參考網絡服務器