Problem with name-based virtual hosts on Ubuntu 16.04 Announcing the arrival of Valued...

Knights and Knaves question

Recursive calls to a function - why is the address of the parameter passed to it lowering with each call?

Will I be more secure with my own router behind my ISP's router?

How to keep bees out of canned beverages?

Can the van der Waals coefficients be negative in the van der Waals equation for real gases?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Why aren't these two solutions equivalent? Combinatorics problem

Why is one lightbulb in a string illuminated?

What *exactly* is electrical current, voltage, and resistance?

Sorting the characters in a utf-16 string in java

Are Flameskulls resistant to magical piercing damage?

Is it OK if I do not take the receipt in Germany?

What is the definining line between a helicopter and a drone a person can ride in?

A journey... into the MIND

Does Prince Arnaud cause someone holding the Princess to lose?

Why do people think Winterfell crypts is the safest place for women, children & old people?

How to make an animal which can only breed for a certain number of generations?

Can a Knight grant Knighthood to another?

How to ask rejected full-time candidates to apply to teach individual courses?

Can I ask an author to send me his ebook?

Can I take recommendation from someone I met at a conference?

Who can become a wight?

Suing a Police Officer Instead of the Police Department

Who's this lady in the war room?



Problem with name-based virtual hosts on Ubuntu 16.04



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Virtual Hosts Not Working (12.10)13.10 Virtual Hosts file doesn't workCorrectly setup apache virtual hosts with multiple usersApache virtual hosts not working (error 403)How to view my virtual hosts sites without editing window etc/hosts - Ubuntu 14.04Virtual hosts apache2 for nette - Ubuntu 14.04Apache2 Virtual Hosts with Ubuntu 15.10 changing DocumentRootapache virtual hosts not workingApache Virtual HostsUbuntu 18.04 Virtual Hosts not affecting properly





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am running Apache 2.4 on Ubuntu 16.04 on a VM in Azure. I am using name-based virtual hosting to host two sites on my server: test.org and dev.test.org. Despite many hours of troubleshooting, my dev.test.org site (on port 80) redirects to my test.org site (port 443).



I have two symbolic links in sites-enabled that, in turn, point back to .conf files in sites-available.



For troubleshooting, I have removed .htaccess files temporarily.



My .conf files are as follows:



First config file:


# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com



ServerAdmin webmaster@localhost
ServerName dev.test.org
#ServerAlias
DocumentRoot /var/www/dev

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf




vim: syntax=apache ts=4 sw=4 sts=4 sr noet



2nd config file:




# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com



ServerAdmin webmaster@localhost
ServerName test.org
ServerAlias www.test.org
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf


Include /etc/letsencrypt/options-ssl-apache.conf



SSLCertificateFile /etc/letsencrypt/live/www.oa.org-0001/fullchain.pem



SSLCertificateKeyFile /etc/letsencrypt/live/www.oa.org-0001/privkey.pem



SSLEngine on
SSLCertificateFile /etc/rapidssl/ssl_certificate.crt
SSLCertificateKeyFile /etc/rapidssl/oa_org.key
SSLCertificateChainFile /etc/rapidssl/IntermediateCA.crt





Anyone? :) Thanks!










share|improve this question







New contributor




INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I am running Apache 2.4 on Ubuntu 16.04 on a VM in Azure. I am using name-based virtual hosting to host two sites on my server: test.org and dev.test.org. Despite many hours of troubleshooting, my dev.test.org site (on port 80) redirects to my test.org site (port 443).



    I have two symbolic links in sites-enabled that, in turn, point back to .conf files in sites-available.



    For troubleshooting, I have removed .htaccess files temporarily.



    My .conf files are as follows:



    First config file:


    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com



    ServerAdmin webmaster@localhost
    ServerName dev.test.org
    #ServerAlias
    DocumentRoot /var/www/dev

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf




    vim: syntax=apache ts=4 sw=4 sts=4 sr noet



    2nd config file:




    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com



    ServerAdmin webmaster@localhost
    ServerName test.org
    ServerAlias www.test.org
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn
    LogLevel debug
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf


    Include /etc/letsencrypt/options-ssl-apache.conf



    SSLCertificateFile /etc/letsencrypt/live/www.oa.org-0001/fullchain.pem



    SSLCertificateKeyFile /etc/letsencrypt/live/www.oa.org-0001/privkey.pem



    SSLEngine on
    SSLCertificateFile /etc/rapidssl/ssl_certificate.crt
    SSLCertificateKeyFile /etc/rapidssl/oa_org.key
    SSLCertificateChainFile /etc/rapidssl/IntermediateCA.crt





    Anyone? :) Thanks!










    share|improve this question







    New contributor




    INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I am running Apache 2.4 on Ubuntu 16.04 on a VM in Azure. I am using name-based virtual hosting to host two sites on my server: test.org and dev.test.org. Despite many hours of troubleshooting, my dev.test.org site (on port 80) redirects to my test.org site (port 443).



      I have two symbolic links in sites-enabled that, in turn, point back to .conf files in sites-available.



      For troubleshooting, I have removed .htaccess files temporarily.



      My .conf files are as follows:



      First config file:


      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      #ServerName www.example.com



      ServerAdmin webmaster@localhost
      ServerName dev.test.org
      #ServerAlias
      DocumentRoot /var/www/dev

      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn

      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined

      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with "a2disconf".
      #Include conf-available/serve-cgi-bin.conf




      vim: syntax=apache ts=4 sw=4 sts=4 sr noet



      2nd config file:




      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      #ServerName www.example.com



      ServerAdmin webmaster@localhost
      ServerName test.org
      ServerAlias www.test.org
      DocumentRoot /var/www/html

      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
      LogLevel debug
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined

      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with "a2disconf".
      #Include conf-available/serve-cgi-bin.conf


      Include /etc/letsencrypt/options-ssl-apache.conf



      SSLCertificateFile /etc/letsencrypt/live/www.oa.org-0001/fullchain.pem



      SSLCertificateKeyFile /etc/letsencrypt/live/www.oa.org-0001/privkey.pem



      SSLEngine on
      SSLCertificateFile /etc/rapidssl/ssl_certificate.crt
      SSLCertificateKeyFile /etc/rapidssl/oa_org.key
      SSLCertificateChainFile /etc/rapidssl/IntermediateCA.crt





      Anyone? :) Thanks!










      share|improve this question







      New contributor




      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am running Apache 2.4 on Ubuntu 16.04 on a VM in Azure. I am using name-based virtual hosting to host two sites on my server: test.org and dev.test.org. Despite many hours of troubleshooting, my dev.test.org site (on port 80) redirects to my test.org site (port 443).



      I have two symbolic links in sites-enabled that, in turn, point back to .conf files in sites-available.



      For troubleshooting, I have removed .htaccess files temporarily.



      My .conf files are as follows:



      First config file:


      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      #ServerName www.example.com



      ServerAdmin webmaster@localhost
      ServerName dev.test.org
      #ServerAlias
      DocumentRoot /var/www/dev

      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn

      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined

      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with "a2disconf".
      #Include conf-available/serve-cgi-bin.conf




      vim: syntax=apache ts=4 sw=4 sts=4 sr noet



      2nd config file:




      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      #ServerName www.example.com



      ServerAdmin webmaster@localhost
      ServerName test.org
      ServerAlias www.test.org
      DocumentRoot /var/www/html

      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
      LogLevel debug
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined

      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with "a2disconf".
      #Include conf-available/serve-cgi-bin.conf


      Include /etc/letsencrypt/options-ssl-apache.conf



      SSLCertificateFile /etc/letsencrypt/live/www.oa.org-0001/fullchain.pem



      SSLCertificateKeyFile /etc/letsencrypt/live/www.oa.org-0001/privkey.pem



      SSLEngine on
      SSLCertificateFile /etc/rapidssl/ssl_certificate.crt
      SSLCertificateKeyFile /etc/rapidssl/oa_org.key
      SSLCertificateChainFile /etc/rapidssl/IntermediateCA.crt





      Anyone? :) Thanks!







      virtual virtualhost






      share|improve this question







      New contributor




      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 7 hours ago









      INSINS

      1




      1




      New contributor




      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      INS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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
          });


          }
          });






          INS is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1136216%2fproblem-with-name-based-virtual-hosts-on-ubuntu-16-04%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








          INS is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          INS is a new contributor. Be nice, and check out our Code of Conduct.













          INS is a new contributor. Be nice, and check out our Code of Conduct.












          INS is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f1136216%2fproblem-with-name-based-virtual-hosts-on-ubuntu-16-04%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

          Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

          Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

          Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...