Ubuntu server 18.04 apache2 how to change the default page?





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







1















I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.



As of now I have to type:
https://myIPaddress/oscommerce/catalog



My default install location for oscommerce is:
/var/www/html/oscommerce/



What I want to type to get to the oscommerce site:
https://myIPaddress



I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
This is what I am running into at this time
Index /










share|improve this question









New contributor




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



























    1















    I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.



    As of now I have to type:
    https://myIPaddress/oscommerce/catalog



    My default install location for oscommerce is:
    /var/www/html/oscommerce/



    What I want to type to get to the oscommerce site:
    https://myIPaddress



    I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
    This is what I am running into at this time
    Index /










    share|improve this question









    New contributor




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























      1












      1








      1








      I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.



      As of now I have to type:
      https://myIPaddress/oscommerce/catalog



      My default install location for oscommerce is:
      /var/www/html/oscommerce/



      What I want to type to get to the oscommerce site:
      https://myIPaddress



      I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
      This is what I am running into at this time
      Index /










      share|improve this question









      New contributor




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












      I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.



      As of now I have to type:
      https://myIPaddress/oscommerce/catalog



      My default install location for oscommerce is:
      /var/www/html/oscommerce/



      What I want to type to get to the oscommerce site:
      https://myIPaddress



      I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
      This is what I am running into at this time
      Index /







      server 18.04 apache2






      share|improve this question









      New contributor




      RKS 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




      RKS 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








      edited yesterday







      RKS













      New contributor




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









      asked 2 days ago









      RKSRKS

      103




      103




      New contributor




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





      New contributor





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






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






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You need to change document root of apache2



          leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
          leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
          DocumentRoot /var/www/html


          Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf

          Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2



          Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.

          To fix file/folder permissions:



          sudo chown -R youruser:www-data /var/www
          sudo chmod -R u=rwX,g=rX,o= /var/www


          Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.



          For index type of error look for DirectoryIndex option in config files



          Edited by User asking the question.
          The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
          Index.html



             <!DOCTYPE html>
          <html>
          <head>
          <meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
          </head>
          <body>

          </body>
          </html>





          share|improve this answer


























          • Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

            – LeonidMew
            yesterday











          • Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

            – LeonidMew
            yesterday











          • its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

            – LeonidMew
            yesterday













          • What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

            – LeonidMew
            yesterday











          • You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

            – LeonidMew
            6 hours ago












          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
          });


          }
          });






          RKS 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%2f1132521%2fubuntu-server-18-04-apache2-how-to-change-the-default-page%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You need to change document root of apache2



          leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
          leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
          DocumentRoot /var/www/html


          Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf

          Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2



          Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.

          To fix file/folder permissions:



          sudo chown -R youruser:www-data /var/www
          sudo chmod -R u=rwX,g=rX,o= /var/www


          Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.



          For index type of error look for DirectoryIndex option in config files



          Edited by User asking the question.
          The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
          Index.html



             <!DOCTYPE html>
          <html>
          <head>
          <meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
          </head>
          <body>

          </body>
          </html>





          share|improve this answer


























          • Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

            – LeonidMew
            yesterday











          • Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

            – LeonidMew
            yesterday











          • its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

            – LeonidMew
            yesterday













          • What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

            – LeonidMew
            yesterday











          • You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

            – LeonidMew
            6 hours ago
















          1














          You need to change document root of apache2



          leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
          leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
          DocumentRoot /var/www/html


          Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf

          Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2



          Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.

          To fix file/folder permissions:



          sudo chown -R youruser:www-data /var/www
          sudo chmod -R u=rwX,g=rX,o= /var/www


          Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.



          For index type of error look for DirectoryIndex option in config files



          Edited by User asking the question.
          The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
          Index.html



             <!DOCTYPE html>
          <html>
          <head>
          <meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
          </head>
          <body>

          </body>
          </html>





          share|improve this answer


























          • Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

            – LeonidMew
            yesterday











          • Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

            – LeonidMew
            yesterday











          • its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

            – LeonidMew
            yesterday













          • What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

            – LeonidMew
            yesterday











          • You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

            – LeonidMew
            6 hours ago














          1












          1








          1







          You need to change document root of apache2



          leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
          leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
          DocumentRoot /var/www/html


          Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf

          Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2



          Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.

          To fix file/folder permissions:



          sudo chown -R youruser:www-data /var/www
          sudo chmod -R u=rwX,g=rX,o= /var/www


          Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.



          For index type of error look for DirectoryIndex option in config files



          Edited by User asking the question.
          The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
          Index.html



             <!DOCTYPE html>
          <html>
          <head>
          <meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
          </head>
          <body>

          </body>
          </html>





          share|improve this answer















          You need to change document root of apache2



          leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
          leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
          DocumentRoot /var/www/html


          Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf

          Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2



          Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.

          To fix file/folder permissions:



          sudo chown -R youruser:www-data /var/www
          sudo chmod -R u=rwX,g=rX,o= /var/www


          Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.



          For index type of error look for DirectoryIndex option in config files



          Edited by User asking the question.
          The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
          Index.html



             <!DOCTYPE html>
          <html>
          <head>
          <meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
          </head>
          <body>

          </body>
          </html>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 6 hours ago









          RKS

          103




          103










          answered 2 days ago









          LeonidMewLeonidMew

          1,036622




          1,036622













          • Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

            – LeonidMew
            yesterday











          • Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

            – LeonidMew
            yesterday











          • its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

            – LeonidMew
            yesterday













          • What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

            – LeonidMew
            yesterday











          • You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

            – LeonidMew
            6 hours ago



















          • Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

            – LeonidMew
            yesterday











          • Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

            – LeonidMew
            yesterday











          • its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

            – LeonidMew
            yesterday













          • What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

            – LeonidMew
            yesterday











          • You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

            – LeonidMew
            6 hours ago

















          Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

          – LeonidMew
          yesterday





          Are there index.html or index.php or some other index in /var/www/html/oscommerce/?

          – LeonidMew
          yesterday













          Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

          – LeonidMew
          yesterday





          Are myipaddress/catalog working? Do you have some site files outside catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.

          – LeonidMew
          yesterday













          its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

          – LeonidMew
          yesterday







          its wrong - /var/www/html/oscommerce/catalog/index.php. It should be DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change

          – LeonidMew
          yesterday















          What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

          – LeonidMew
          yesterday





          What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.

          – LeonidMew
          yesterday













          You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

          – LeonidMew
          6 hours ago





          You may also do redirect by index.php file, with the following content: <?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');

          – LeonidMew
          6 hours ago










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










          draft saved

          draft discarded


















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













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












          RKS 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%2f1132521%2fubuntu-server-18-04-apache2-how-to-change-the-default-page%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

          香粉寮

          GameSpot