LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-12-2015, 02:29 AM   #1
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Rep: Reputation: Disabled
Apache configuration


I use Apache server .

I have two different DocumentRoot and would like to setup two virtualhost , so that two different port can serve different DocumentRoot , I use the below URL but do not work , when I use this method , even I use connect 80 or 8080 , it also re-direct to port 80 , would advise if I use the wrong method ? very thanks


http://httpd.apache.org/docs/2.2/vhosts/examples.html

Code:
Server configuration

 Listen 80
 Listen 8080

 NameVirtualHost 172.20.30.40:80
 NameVirtualHost 172.20.30.40:8080

 <VirtualHost 172.20.30.40:80>
 ServerName www.example.com
 DocumentRoot /www/domain-80
 </VirtualHost>

 <VirtualHost 172.20.30.40:8080>
 ServerName www.example.com
 DocumentRoot /www/domain-8080
 </VirtualHost>

 <VirtualHost 172.20.30.40:80>
 ServerName www.example.org
 DocumentRoot /www/otherdomain-80
 </VirtualHost>

 <VirtualHost 172.20.30.40:8080>
 ServerName www.example.org
 DocumentRoot /www/otherdomain-8080
 </VirtualHost>

Last edited by byran cheung; 02-12-2015 at 02:31 AM.
 
Old 02-12-2015, 10:28 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
The ServerName for both 80 and 8080 in the first example is the same. It matches on the first one searched, which is 80.
Try naming the 8080 Servernames something unique as in the Apache doc's :

ServerName www.example.org for 80, ServerName www.anotherexample.org for 8080.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to Add mod_evasive configuration to Apache configuration file.? Unknown3r Linux - Newbie 1 11-04-2012 10:09 AM
Apache 2.0 configuration mulayanup Linux - Server 2 08-16-2010 03:25 AM
Migrating Apache 1.3 configuration files to Apache 2 kaplan71 Linux - Software 0 03-28-2007 11:05 AM
Apache Configuration chimp Linux - Newbie 3 12-14-2004 05:24 PM
apache configuration hardigunawan Linux - Newbie 1 06-21-2002 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration