Apache VirtuaHosts - only first host being picked up












0















Been given an apache headache by the previous sysadmin here who left in a hurry! Looking at the config, apache2 starts fine, but its only picking up the first VirtualHost - any ideas what he's done here ? I can't seem to work it out



NameVirtualHost 127.0.0.1:81
##NameVirtualHost *

<VirtualHost *:81>
##ServerName 127.0.0.1
DocumentRoot /usr/local/apache2/htdocs/querystore/htdocs
Options Includes Indexes FollowSymLinks
ErrorLog /usr/local/apache2/htdocs/querystore/logs/error.log
CustomLog /usr/local/apache2/htdocs/querystore/logs/access.log common
ScriptAlias /cgi-bin/ "/usr/local/apache2/htdocs/querystore/cgi-bin/"
AddType text/html .shtml
AddType application/pdf .pdf
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml
AddHandler cgi-script .cgi

<Directory "/usr/local/apache2/htdocs/querystore/htdocs/">
Options Includes +ExecCGI Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
##Order allow,deny
##Allow from all
SetEnvIf Request_URI "(/home.html)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
</Directory>

<Directory "/usr/local/apache2/htdocs/querystore/cgi-bin/">
Options Includes Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

<VirtualHost *:81>
##<VirtualHost 127.0.0.1>
##ServerName 127.0.0.1
Options +Includes Indexes FollowSymLinks
DocumentRoot /tomcat/query/htdocs
ErrorLog /tomcat/query/nav_error.log
CustomLog /tomcat/query/nav_access.log common
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml


<Directory "/tomcat/query/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

JkMount /servlet/* query
</VirtualHost>


I've changed the IP address to localhost as im posting it on here, so its not localhost (figured it was safer!).



Thanks :)










share|improve this question


















  • 1





    It appears that the server name is the same currently. Also, it is a best practice to separate vhosts into separate files.

    – juniorRubyist
    Feb 8 at 23:28


















0















Been given an apache headache by the previous sysadmin here who left in a hurry! Looking at the config, apache2 starts fine, but its only picking up the first VirtualHost - any ideas what he's done here ? I can't seem to work it out



NameVirtualHost 127.0.0.1:81
##NameVirtualHost *

<VirtualHost *:81>
##ServerName 127.0.0.1
DocumentRoot /usr/local/apache2/htdocs/querystore/htdocs
Options Includes Indexes FollowSymLinks
ErrorLog /usr/local/apache2/htdocs/querystore/logs/error.log
CustomLog /usr/local/apache2/htdocs/querystore/logs/access.log common
ScriptAlias /cgi-bin/ "/usr/local/apache2/htdocs/querystore/cgi-bin/"
AddType text/html .shtml
AddType application/pdf .pdf
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml
AddHandler cgi-script .cgi

<Directory "/usr/local/apache2/htdocs/querystore/htdocs/">
Options Includes +ExecCGI Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
##Order allow,deny
##Allow from all
SetEnvIf Request_URI "(/home.html)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
</Directory>

<Directory "/usr/local/apache2/htdocs/querystore/cgi-bin/">
Options Includes Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

<VirtualHost *:81>
##<VirtualHost 127.0.0.1>
##ServerName 127.0.0.1
Options +Includes Indexes FollowSymLinks
DocumentRoot /tomcat/query/htdocs
ErrorLog /tomcat/query/nav_error.log
CustomLog /tomcat/query/nav_access.log common
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml


<Directory "/tomcat/query/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

JkMount /servlet/* query
</VirtualHost>


I've changed the IP address to localhost as im posting it on here, so its not localhost (figured it was safer!).



Thanks :)










share|improve this question


















  • 1





    It appears that the server name is the same currently. Also, it is a best practice to separate vhosts into separate files.

    – juniorRubyist
    Feb 8 at 23:28
















0












0








0








Been given an apache headache by the previous sysadmin here who left in a hurry! Looking at the config, apache2 starts fine, but its only picking up the first VirtualHost - any ideas what he's done here ? I can't seem to work it out



NameVirtualHost 127.0.0.1:81
##NameVirtualHost *

<VirtualHost *:81>
##ServerName 127.0.0.1
DocumentRoot /usr/local/apache2/htdocs/querystore/htdocs
Options Includes Indexes FollowSymLinks
ErrorLog /usr/local/apache2/htdocs/querystore/logs/error.log
CustomLog /usr/local/apache2/htdocs/querystore/logs/access.log common
ScriptAlias /cgi-bin/ "/usr/local/apache2/htdocs/querystore/cgi-bin/"
AddType text/html .shtml
AddType application/pdf .pdf
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml
AddHandler cgi-script .cgi

<Directory "/usr/local/apache2/htdocs/querystore/htdocs/">
Options Includes +ExecCGI Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
##Order allow,deny
##Allow from all
SetEnvIf Request_URI "(/home.html)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
</Directory>

<Directory "/usr/local/apache2/htdocs/querystore/cgi-bin/">
Options Includes Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

<VirtualHost *:81>
##<VirtualHost 127.0.0.1>
##ServerName 127.0.0.1
Options +Includes Indexes FollowSymLinks
DocumentRoot /tomcat/query/htdocs
ErrorLog /tomcat/query/nav_error.log
CustomLog /tomcat/query/nav_access.log common
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml


<Directory "/tomcat/query/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

JkMount /servlet/* query
</VirtualHost>


I've changed the IP address to localhost as im posting it on here, so its not localhost (figured it was safer!).



Thanks :)










share|improve this question














Been given an apache headache by the previous sysadmin here who left in a hurry! Looking at the config, apache2 starts fine, but its only picking up the first VirtualHost - any ideas what he's done here ? I can't seem to work it out



NameVirtualHost 127.0.0.1:81
##NameVirtualHost *

<VirtualHost *:81>
##ServerName 127.0.0.1
DocumentRoot /usr/local/apache2/htdocs/querystore/htdocs
Options Includes Indexes FollowSymLinks
ErrorLog /usr/local/apache2/htdocs/querystore/logs/error.log
CustomLog /usr/local/apache2/htdocs/querystore/logs/access.log common
ScriptAlias /cgi-bin/ "/usr/local/apache2/htdocs/querystore/cgi-bin/"
AddType text/html .shtml
AddType application/pdf .pdf
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml
AddHandler cgi-script .cgi

<Directory "/usr/local/apache2/htdocs/querystore/htdocs/">
Options Includes +ExecCGI Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
##Order allow,deny
##Allow from all
SetEnvIf Request_URI "(/home.html)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
</Directory>

<Directory "/usr/local/apache2/htdocs/querystore/cgi-bin/">
Options Includes Indexes FollowSymLinks
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

<VirtualHost *:81>
##<VirtualHost 127.0.0.1>
##ServerName 127.0.0.1
Options +Includes Indexes FollowSymLinks
DocumentRoot /tomcat/query/htdocs
ErrorLog /tomcat/query/nav_error.log
CustomLog /tomcat/query/nav_access.log common
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml


<Directory "/tomcat/query/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

JkMount /servlet/* query
</VirtualHost>


I've changed the IP address to localhost as im posting it on here, so its not localhost (figured it was safer!).



Thanks :)







apache-http-server






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 8 at 15:26









SQLNoobSQLNoob

1




1








  • 1





    It appears that the server name is the same currently. Also, it is a best practice to separate vhosts into separate files.

    – juniorRubyist
    Feb 8 at 23:28
















  • 1





    It appears that the server name is the same currently. Also, it is a best practice to separate vhosts into separate files.

    – juniorRubyist
    Feb 8 at 23:28










1




1





It appears that the server name is the same currently. Also, it is a best practice to separate vhosts into separate files.

– juniorRubyist
Feb 8 at 23:28







It appears that the server name is the same currently. Also, it is a best practice to separate vhosts into separate files.

– juniorRubyist
Feb 8 at 23:28












0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403571%2fapache-virtuahosts-only-first-host-being-picked-up%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403571%2fapache-virtuahosts-only-first-host-being-picked-up%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?