[GUIDE]How to Host Multiple (SSL) Website In One VPS (Debian/Ubuntu) ApacheHow to determine JAVA_HOME on...

Life insurance that covers only simultaneous/dual deaths

What is the definition of "Natural Selection"?

When were linguistics departments first established

Examples of odd-dimensional manifolds that do not admit contact structure

What exactly is the purpose of connection links straped between the rocket and the launch pad

PTIJ: How can I halachically kill a vampire?

US to Europe trip with Canada layover- is 52 minutes enough?

redhat 7 + How to stop systemctl service permanent

Why doesn't the EU now just force the UK to choose between referendum and no-deal?

Why don't MCU characters ever seem to have language issues?

Time dilation for a moving electronic clock

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Is it illegal in Germany to take sick leave if you caused your own illness with food?

Word for a person who has no opinion about whether god exists

Is this animal really missing?

Why do Australian milk farmers need to protest supermarkets' milk price?

Good allowance savings plan?

Is all copper pipe pretty much the same?

Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?

Unreachable code, but reachable with exception

Who is our nearest neighbor

Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?

Confusion with the nameplate of an induction motor

Running a subshell from the middle of the current command



[GUIDE]How to Host Multiple (SSL) Website In One VPS (Debian/Ubuntu) Apache


How to determine JAVA_HOME on Debian/Ubuntu?Host-header from requests are ignored?wildcard subdomains for wordpress networkCan I host multiple sites with one Amazon EC2 instanceAdding additional host to Apache2nginx, dns - domain.com resolves but subdomain.domain.com doesn'tVirtualHost's server name does not work (shows /var/www), all aliases doDifferent subdomains, apache responding with the same vhostOne host, one static/public ip, multiple vps, multiple domains. How to route? Debian Linuxwebsite which configured with webmin always redirects to default apache2 index file













0















[GUIDE]How to Host Multiple (SSL) Website In One VPS (Debian/Ubuntu) Apache



I will host 3 website




  1. dinpubg.tk

  2. encikwira.tk

  3. goebelajarsistem.tk (this site will be https)


Grab Debian/Ubuntu VPS



1. apt-get update

2. apt-get install apache2

3. nano /etc/apache2/sites-available/dinpubg.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/dinpubg.tk ServerName dinpubg.tk ServerAlias www.dinpubg.tk </VirtualHost>

4. nano /etc/apache2/sites-available/encikwira.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/encikwira.tk ServerName encikwira.tk ServerAlias www.encikwira.tk </VirtualHost>

5. nano /etc/apache2/sites-available/goebelajarsistem.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/goebelajarsistem.tk ServerName goebelajarsistem.tk ServerAlias www.goebelajarsistem.tk </VirtualHost> <IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin admin@goebelajarsistem.tk
DocumentRoot /var/www/html/goebelajarsistem.tk
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
BrowserMatch "MSIE [2-6]"
nokeepalive ssl-unclean-shutdown
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost> </IfModule>

6. sudo a2ensite dinpubg.tk.conf

7. sudo a2ensite encikwira.tk.conf

8. sudo a2ensite goebelajarsistem.tk.conf

9. a2enmod ssl

10. sudo service apache2 restart

11. sudo mkdir -p /var/www/html/dinpubg.tk

12. sudo mkdir -p /var/www/html/encikwira.tk

13. sudo mkdir -p /var/www/html/goebelajarsistem.tk

14. sudo chown -R www-data:www-data -R /var/www/html/dinpubg.tk*

15. sudo chown -R www-data:www-data -R /var/www/html/encikwira.tk*

16. sudo chown -R www-data:www-data -R /var/www/html/goebelajarsistem.tk*


DNS Record for each domain point to VPS Ip




  • Go to domain registrar, my case freenom for http (dinpubg.tk)


    1. type - A, target - VPS ip, name - leave blank

    2. type - A, target - VPS ip, name - www for http (dinpubg.tk)

    3. type - A, target - VPS ip, name - leave blank

    4. type - A, target - VPS ip, name - www for https (https://goebelajarsistem.tk) - using free Cloudflare SSL

    5. type - A, value - VPS ip, name - goebelajarsistem.tk

    6. type - A, value - VPS ip, name - www *tick always use https in cloudflare




For uploading website using FileZilla (in my case, i use Google Cloud Platform)




  1. generate key using puttygen and save private key (no password)

  2. on filezilla setting, load the key generate before host : sftp://server_ip_address, username : refer comment of the key in the puttygen before, password : leave blank

  3. sudo chmod -R 777 /var/www/html/encikwira.tk, dinpubg.tk, goebelajarsistem.tk

  4. upload your website files to /var/www/html/(domain)


thats all... happy hosting!



MY QUESTION IS,



everytime i need to add new domain to the hosting, i need to set all manualy, from above step (editing the vhost file and so on) how to create easy menu script in batch terminal?



example script :



Do You Want To Add Domain To This hosting? (1-yes 2 no)

Tell Me The Domain Name (enter domain1.com)

Creating... /etc/apache2/sites-available/domain1.com.conf

<VirtualHost *:80> DocumentRoot /var/www/html/domain1.com ServerName serverfault.com ServerAlias www.domain1.com </VirtualHost>

sudo mkdir -p /var/www/html/domain1.com... sudo chown -R www-data:www-data -R /var/www/html/domain1.com*


Thank you so much









share









New contributor




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

























    0















    [GUIDE]How to Host Multiple (SSL) Website In One VPS (Debian/Ubuntu) Apache



    I will host 3 website




    1. dinpubg.tk

    2. encikwira.tk

    3. goebelajarsistem.tk (this site will be https)


    Grab Debian/Ubuntu VPS



    1. apt-get update

    2. apt-get install apache2

    3. nano /etc/apache2/sites-available/dinpubg.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/dinpubg.tk ServerName dinpubg.tk ServerAlias www.dinpubg.tk </VirtualHost>

    4. nano /etc/apache2/sites-available/encikwira.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/encikwira.tk ServerName encikwira.tk ServerAlias www.encikwira.tk </VirtualHost>

    5. nano /etc/apache2/sites-available/goebelajarsistem.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/goebelajarsistem.tk ServerName goebelajarsistem.tk ServerAlias www.goebelajarsistem.tk </VirtualHost> <IfModule mod_ssl.c>
    <VirtualHost _default_:443>
    ServerAdmin admin@goebelajarsistem.tk
    DocumentRoot /var/www/html/goebelajarsistem.tk
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/apache.crt
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key
    BrowserMatch "MSIE [2-6]"
    nokeepalive ssl-unclean-shutdown
    downgrade-1.0 force-response-1.0
    # MSIE 7 and newer should be able to use keepalive
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
    </VirtualHost> </IfModule>

    6. sudo a2ensite dinpubg.tk.conf

    7. sudo a2ensite encikwira.tk.conf

    8. sudo a2ensite goebelajarsistem.tk.conf

    9. a2enmod ssl

    10. sudo service apache2 restart

    11. sudo mkdir -p /var/www/html/dinpubg.tk

    12. sudo mkdir -p /var/www/html/encikwira.tk

    13. sudo mkdir -p /var/www/html/goebelajarsistem.tk

    14. sudo chown -R www-data:www-data -R /var/www/html/dinpubg.tk*

    15. sudo chown -R www-data:www-data -R /var/www/html/encikwira.tk*

    16. sudo chown -R www-data:www-data -R /var/www/html/goebelajarsistem.tk*


    DNS Record for each domain point to VPS Ip




    • Go to domain registrar, my case freenom for http (dinpubg.tk)


      1. type - A, target - VPS ip, name - leave blank

      2. type - A, target - VPS ip, name - www for http (dinpubg.tk)

      3. type - A, target - VPS ip, name - leave blank

      4. type - A, target - VPS ip, name - www for https (https://goebelajarsistem.tk) - using free Cloudflare SSL

      5. type - A, value - VPS ip, name - goebelajarsistem.tk

      6. type - A, value - VPS ip, name - www *tick always use https in cloudflare




    For uploading website using FileZilla (in my case, i use Google Cloud Platform)




    1. generate key using puttygen and save private key (no password)

    2. on filezilla setting, load the key generate before host : sftp://server_ip_address, username : refer comment of the key in the puttygen before, password : leave blank

    3. sudo chmod -R 777 /var/www/html/encikwira.tk, dinpubg.tk, goebelajarsistem.tk

    4. upload your website files to /var/www/html/(domain)


    thats all... happy hosting!



    MY QUESTION IS,



    everytime i need to add new domain to the hosting, i need to set all manualy, from above step (editing the vhost file and so on) how to create easy menu script in batch terminal?



    example script :



    Do You Want To Add Domain To This hosting? (1-yes 2 no)

    Tell Me The Domain Name (enter domain1.com)

    Creating... /etc/apache2/sites-available/domain1.com.conf

    <VirtualHost *:80> DocumentRoot /var/www/html/domain1.com ServerName serverfault.com ServerAlias www.domain1.com </VirtualHost>

    sudo mkdir -p /var/www/html/domain1.com... sudo chown -R www-data:www-data -R /var/www/html/domain1.com*


    Thank you so much









    share









    New contributor




    Ardy Shazril 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








      [GUIDE]How to Host Multiple (SSL) Website In One VPS (Debian/Ubuntu) Apache



      I will host 3 website




      1. dinpubg.tk

      2. encikwira.tk

      3. goebelajarsistem.tk (this site will be https)


      Grab Debian/Ubuntu VPS



      1. apt-get update

      2. apt-get install apache2

      3. nano /etc/apache2/sites-available/dinpubg.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/dinpubg.tk ServerName dinpubg.tk ServerAlias www.dinpubg.tk </VirtualHost>

      4. nano /etc/apache2/sites-available/encikwira.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/encikwira.tk ServerName encikwira.tk ServerAlias www.encikwira.tk </VirtualHost>

      5. nano /etc/apache2/sites-available/goebelajarsistem.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/goebelajarsistem.tk ServerName goebelajarsistem.tk ServerAlias www.goebelajarsistem.tk </VirtualHost> <IfModule mod_ssl.c>
      <VirtualHost _default_:443>
      ServerAdmin admin@goebelajarsistem.tk
      DocumentRoot /var/www/html/goebelajarsistem.tk
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
      SSLEngine on
      SSLCertificateFile /etc/apache2/ssl/apache.crt
      SSLCertificateKeyFile /etc/apache2/ssl/apache.key
      BrowserMatch "MSIE [2-6]"
      nokeepalive ssl-unclean-shutdown
      downgrade-1.0 force-response-1.0
      # MSIE 7 and newer should be able to use keepalive
      BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
      </VirtualHost> </IfModule>

      6. sudo a2ensite dinpubg.tk.conf

      7. sudo a2ensite encikwira.tk.conf

      8. sudo a2ensite goebelajarsistem.tk.conf

      9. a2enmod ssl

      10. sudo service apache2 restart

      11. sudo mkdir -p /var/www/html/dinpubg.tk

      12. sudo mkdir -p /var/www/html/encikwira.tk

      13. sudo mkdir -p /var/www/html/goebelajarsistem.tk

      14. sudo chown -R www-data:www-data -R /var/www/html/dinpubg.tk*

      15. sudo chown -R www-data:www-data -R /var/www/html/encikwira.tk*

      16. sudo chown -R www-data:www-data -R /var/www/html/goebelajarsistem.tk*


      DNS Record for each domain point to VPS Ip




      • Go to domain registrar, my case freenom for http (dinpubg.tk)


        1. type - A, target - VPS ip, name - leave blank

        2. type - A, target - VPS ip, name - www for http (dinpubg.tk)

        3. type - A, target - VPS ip, name - leave blank

        4. type - A, target - VPS ip, name - www for https (https://goebelajarsistem.tk) - using free Cloudflare SSL

        5. type - A, value - VPS ip, name - goebelajarsistem.tk

        6. type - A, value - VPS ip, name - www *tick always use https in cloudflare




      For uploading website using FileZilla (in my case, i use Google Cloud Platform)




      1. generate key using puttygen and save private key (no password)

      2. on filezilla setting, load the key generate before host : sftp://server_ip_address, username : refer comment of the key in the puttygen before, password : leave blank

      3. sudo chmod -R 777 /var/www/html/encikwira.tk, dinpubg.tk, goebelajarsistem.tk

      4. upload your website files to /var/www/html/(domain)


      thats all... happy hosting!



      MY QUESTION IS,



      everytime i need to add new domain to the hosting, i need to set all manualy, from above step (editing the vhost file and so on) how to create easy menu script in batch terminal?



      example script :



      Do You Want To Add Domain To This hosting? (1-yes 2 no)

      Tell Me The Domain Name (enter domain1.com)

      Creating... /etc/apache2/sites-available/domain1.com.conf

      <VirtualHost *:80> DocumentRoot /var/www/html/domain1.com ServerName serverfault.com ServerAlias www.domain1.com </VirtualHost>

      sudo mkdir -p /var/www/html/domain1.com... sudo chown -R www-data:www-data -R /var/www/html/domain1.com*


      Thank you so much









      share









      New contributor




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












      [GUIDE]How to Host Multiple (SSL) Website In One VPS (Debian/Ubuntu) Apache



      I will host 3 website




      1. dinpubg.tk

      2. encikwira.tk

      3. goebelajarsistem.tk (this site will be https)


      Grab Debian/Ubuntu VPS



      1. apt-get update

      2. apt-get install apache2

      3. nano /etc/apache2/sites-available/dinpubg.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/dinpubg.tk ServerName dinpubg.tk ServerAlias www.dinpubg.tk </VirtualHost>

      4. nano /etc/apache2/sites-available/encikwira.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/encikwira.tk ServerName encikwira.tk ServerAlias www.encikwira.tk </VirtualHost>

      5. nano /etc/apache2/sites-available/goebelajarsistem.tk.conf <VirtualHost *:80> DocumentRoot /var/www/html/goebelajarsistem.tk ServerName goebelajarsistem.tk ServerAlias www.goebelajarsistem.tk </VirtualHost> <IfModule mod_ssl.c>
      <VirtualHost _default_:443>
      ServerAdmin admin@goebelajarsistem.tk
      DocumentRoot /var/www/html/goebelajarsistem.tk
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
      SSLEngine on
      SSLCertificateFile /etc/apache2/ssl/apache.crt
      SSLCertificateKeyFile /etc/apache2/ssl/apache.key
      BrowserMatch "MSIE [2-6]"
      nokeepalive ssl-unclean-shutdown
      downgrade-1.0 force-response-1.0
      # MSIE 7 and newer should be able to use keepalive
      BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
      </VirtualHost> </IfModule>

      6. sudo a2ensite dinpubg.tk.conf

      7. sudo a2ensite encikwira.tk.conf

      8. sudo a2ensite goebelajarsistem.tk.conf

      9. a2enmod ssl

      10. sudo service apache2 restart

      11. sudo mkdir -p /var/www/html/dinpubg.tk

      12. sudo mkdir -p /var/www/html/encikwira.tk

      13. sudo mkdir -p /var/www/html/goebelajarsistem.tk

      14. sudo chown -R www-data:www-data -R /var/www/html/dinpubg.tk*

      15. sudo chown -R www-data:www-data -R /var/www/html/encikwira.tk*

      16. sudo chown -R www-data:www-data -R /var/www/html/goebelajarsistem.tk*


      DNS Record for each domain point to VPS Ip




      • Go to domain registrar, my case freenom for http (dinpubg.tk)


        1. type - A, target - VPS ip, name - leave blank

        2. type - A, target - VPS ip, name - www for http (dinpubg.tk)

        3. type - A, target - VPS ip, name - leave blank

        4. type - A, target - VPS ip, name - www for https (https://goebelajarsistem.tk) - using free Cloudflare SSL

        5. type - A, value - VPS ip, name - goebelajarsistem.tk

        6. type - A, value - VPS ip, name - www *tick always use https in cloudflare




      For uploading website using FileZilla (in my case, i use Google Cloud Platform)




      1. generate key using puttygen and save private key (no password)

      2. on filezilla setting, load the key generate before host : sftp://server_ip_address, username : refer comment of the key in the puttygen before, password : leave blank

      3. sudo chmod -R 777 /var/www/html/encikwira.tk, dinpubg.tk, goebelajarsistem.tk

      4. upload your website files to /var/www/html/(domain)


      thats all... happy hosting!



      MY QUESTION IS,



      everytime i need to add new domain to the hosting, i need to set all manualy, from above step (editing the vhost file and so on) how to create easy menu script in batch terminal?



      example script :



      Do You Want To Add Domain To This hosting? (1-yes 2 no)

      Tell Me The Domain Name (enter domain1.com)

      Creating... /etc/apache2/sites-available/domain1.com.conf

      <VirtualHost *:80> DocumentRoot /var/www/html/domain1.com ServerName serverfault.com ServerAlias www.domain1.com </VirtualHost>

      sudo mkdir -p /var/www/html/domain1.com... sudo chown -R www-data:www-data -R /var/www/html/domain1.com*


      Thank you so much







      domain-name-system debian vps website





      share









      New contributor




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










      share









      New contributor




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








      share



      share








      edited 1 min ago







      Ardy Shazril













      New contributor




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









      asked 9 mins ago









      Ardy ShazrilArdy Shazril

      1




      1




      New contributor




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





      New contributor





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






      Ardy Shazril 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: "2"
          };
          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
          });


          }
          });






          Ardy Shazril 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%2fserverfault.com%2fquestions%2f958181%2fguidehow-to-host-multiple-ssl-website-in-one-vps-debian-ubuntu-apache%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








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










          draft saved

          draft discarded


















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













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












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
















          Thanks for contributing an answer to Server Fault!


          • 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%2fserverfault.com%2fquestions%2f958181%2fguidehow-to-host-multiple-ssl-website-in-one-vps-debian-ubuntu-apache%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

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...