Where should be located a web application in Linux?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3















Here is an example of the file structure of a Linux distro:
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-filesystem-fhs.html



Each directory has a specific purpose, and seems like a web application should be distributed in different directories rather than being encapsulated in a folder.



The initial structure of my web app is as follows:



/home/username/appname/appsource...
/home/username/appname/appconfiguration...
/home/username/appname/apptempdata...
/home/username/appname/applogdata...
/home/username/appname/appdata...
/home/username/public_html/appname/appsite/...


The app is encapsulated in a minimum of directories within the Linux system, one for the web-source/web-site (the pages, javascript, css, website images), in the other directory (/home/username/appname/...) is the rest of the application files.



The application was initially placed in an user folder just because that's where the web app started developing through certain web tool, but now is needed to break away the app from the web tool and from the server user, and is needed to create an installation method (in the end different admin users of a given Linux server will rotate to manage the application files if given permission in the Linux system).



From what I researched (see the FHS specifications), I understand that the app files have to be redistributed as follows:



/usr/lib/appname/appsource...
/etc/appname/appconfiguration...
/var/www/html/appname/appsite...
/var/tmp/appname/apptempdata...
/var/log/appname/applogdata...
/var/lib/appname/appdata...


If I was to just make things work now, I would just place everything in the /var/lib and /var/www/html directories:



/var/lib/appname/appsource...
/var/lib/appname/appconfiguration...
/var/www/html/appname/appsite...
/var/lib/appname/apptempdata...
/var/lib/appname/applogdata...
/var/lib/appname/appdata...


Should I do that? If not then please explain what are the main reasons, and how should the example files be located?










share|improve this question















migrated from softwareengineering.stackexchange.com Jun 10 '17 at 19:35


This question came from our site for professionals, academics, and students working within the systems development life cycle.






















    3















    Here is an example of the file structure of a Linux distro:
    https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-filesystem-fhs.html



    Each directory has a specific purpose, and seems like a web application should be distributed in different directories rather than being encapsulated in a folder.



    The initial structure of my web app is as follows:



    /home/username/appname/appsource...
    /home/username/appname/appconfiguration...
    /home/username/appname/apptempdata...
    /home/username/appname/applogdata...
    /home/username/appname/appdata...
    /home/username/public_html/appname/appsite/...


    The app is encapsulated in a minimum of directories within the Linux system, one for the web-source/web-site (the pages, javascript, css, website images), in the other directory (/home/username/appname/...) is the rest of the application files.



    The application was initially placed in an user folder just because that's where the web app started developing through certain web tool, but now is needed to break away the app from the web tool and from the server user, and is needed to create an installation method (in the end different admin users of a given Linux server will rotate to manage the application files if given permission in the Linux system).



    From what I researched (see the FHS specifications), I understand that the app files have to be redistributed as follows:



    /usr/lib/appname/appsource...
    /etc/appname/appconfiguration...
    /var/www/html/appname/appsite...
    /var/tmp/appname/apptempdata...
    /var/log/appname/applogdata...
    /var/lib/appname/appdata...


    If I was to just make things work now, I would just place everything in the /var/lib and /var/www/html directories:



    /var/lib/appname/appsource...
    /var/lib/appname/appconfiguration...
    /var/www/html/appname/appsite...
    /var/lib/appname/apptempdata...
    /var/lib/appname/applogdata...
    /var/lib/appname/appdata...


    Should I do that? If not then please explain what are the main reasons, and how should the example files be located?










    share|improve this question















    migrated from softwareengineering.stackexchange.com Jun 10 '17 at 19:35


    This question came from our site for professionals, academics, and students working within the systems development life cycle.




















      3












      3








      3








      Here is an example of the file structure of a Linux distro:
      https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-filesystem-fhs.html



      Each directory has a specific purpose, and seems like a web application should be distributed in different directories rather than being encapsulated in a folder.



      The initial structure of my web app is as follows:



      /home/username/appname/appsource...
      /home/username/appname/appconfiguration...
      /home/username/appname/apptempdata...
      /home/username/appname/applogdata...
      /home/username/appname/appdata...
      /home/username/public_html/appname/appsite/...


      The app is encapsulated in a minimum of directories within the Linux system, one for the web-source/web-site (the pages, javascript, css, website images), in the other directory (/home/username/appname/...) is the rest of the application files.



      The application was initially placed in an user folder just because that's where the web app started developing through certain web tool, but now is needed to break away the app from the web tool and from the server user, and is needed to create an installation method (in the end different admin users of a given Linux server will rotate to manage the application files if given permission in the Linux system).



      From what I researched (see the FHS specifications), I understand that the app files have to be redistributed as follows:



      /usr/lib/appname/appsource...
      /etc/appname/appconfiguration...
      /var/www/html/appname/appsite...
      /var/tmp/appname/apptempdata...
      /var/log/appname/applogdata...
      /var/lib/appname/appdata...


      If I was to just make things work now, I would just place everything in the /var/lib and /var/www/html directories:



      /var/lib/appname/appsource...
      /var/lib/appname/appconfiguration...
      /var/www/html/appname/appsite...
      /var/lib/appname/apptempdata...
      /var/lib/appname/applogdata...
      /var/lib/appname/appdata...


      Should I do that? If not then please explain what are the main reasons, and how should the example files be located?










      share|improve this question
















      Here is an example of the file structure of a Linux distro:
      https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-filesystem-fhs.html



      Each directory has a specific purpose, and seems like a web application should be distributed in different directories rather than being encapsulated in a folder.



      The initial structure of my web app is as follows:



      /home/username/appname/appsource...
      /home/username/appname/appconfiguration...
      /home/username/appname/apptempdata...
      /home/username/appname/applogdata...
      /home/username/appname/appdata...
      /home/username/public_html/appname/appsite/...


      The app is encapsulated in a minimum of directories within the Linux system, one for the web-source/web-site (the pages, javascript, css, website images), in the other directory (/home/username/appname/...) is the rest of the application files.



      The application was initially placed in an user folder just because that's where the web app started developing through certain web tool, but now is needed to break away the app from the web tool and from the server user, and is needed to create an installation method (in the end different admin users of a given Linux server will rotate to manage the application files if given permission in the Linux system).



      From what I researched (see the FHS specifications), I understand that the app files have to be redistributed as follows:



      /usr/lib/appname/appsource...
      /etc/appname/appconfiguration...
      /var/www/html/appname/appsite...
      /var/tmp/appname/apptempdata...
      /var/log/appname/applogdata...
      /var/lib/appname/appdata...


      If I was to just make things work now, I would just place everything in the /var/lib and /var/www/html directories:



      /var/lib/appname/appsource...
      /var/lib/appname/appconfiguration...
      /var/www/html/appname/appsite...
      /var/lib/appname/apptempdata...
      /var/lib/appname/applogdata...
      /var/lib/appname/appdata...


      Should I do that? If not then please explain what are the main reasons, and how should the example files be located?







      linux directory-structure






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 25 at 18:01







      mikl

















      asked Jun 9 '17 at 19:57









      miklmikl

      1655




      1655




      migrated from softwareengineering.stackexchange.com Jun 10 '17 at 19:35


      This question came from our site for professionals, academics, and students working within the systems development life cycle.









      migrated from softwareengineering.stackexchange.com Jun 10 '17 at 19:35


      This question came from our site for professionals, academics, and students working within the systems development life cycle.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I am not an expert on this topic, but the original solution I came to by reading the FHS specifications, seems to be actually right (or pretty close), I even found this article, which says that the /opt and /usr/local directories are not necessary anymore with the apparition of RPM's, that article says that those directories are now obsolete and make sysadmins' and users' life less easy.



          All my web application is written in PHP, which means that my app does not include any binaries, so I just put all the application programs in /usr/lib. If your application has binaries, you will need /usr/bin or /usr/sbin. I don't either use /usr/share/doc nor /usr/share/man, because my app doesn't include documentation nor manuals (for the moment).



          /var/www is not part of the FHS, so the files located in /var/www/html/appsite can be placed somewhere else, it will depend on how you configure the web server application (Apache, Nginx or other).



          On the other hand, the second approach in the OP is discarded, because it's just lazy and doesn't really try to comply with the FHS.



          So my conclution remains:



          /usr/lib/appname/appsource...
          /etc/appname/appconfiguration...
          /var/www/html/appname/appsite...
          /var/tmp/appname/apptempdata...
          /var/log/appname/applogdata...
          /var/lib/appname/appdata...





          share|improve this answer
























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f370408%2fwhere-should-be-located-a-web-application-in-linux%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









            0














            I am not an expert on this topic, but the original solution I came to by reading the FHS specifications, seems to be actually right (or pretty close), I even found this article, which says that the /opt and /usr/local directories are not necessary anymore with the apparition of RPM's, that article says that those directories are now obsolete and make sysadmins' and users' life less easy.



            All my web application is written in PHP, which means that my app does not include any binaries, so I just put all the application programs in /usr/lib. If your application has binaries, you will need /usr/bin or /usr/sbin. I don't either use /usr/share/doc nor /usr/share/man, because my app doesn't include documentation nor manuals (for the moment).



            /var/www is not part of the FHS, so the files located in /var/www/html/appsite can be placed somewhere else, it will depend on how you configure the web server application (Apache, Nginx or other).



            On the other hand, the second approach in the OP is discarded, because it's just lazy and doesn't really try to comply with the FHS.



            So my conclution remains:



            /usr/lib/appname/appsource...
            /etc/appname/appconfiguration...
            /var/www/html/appname/appsite...
            /var/tmp/appname/apptempdata...
            /var/log/appname/applogdata...
            /var/lib/appname/appdata...





            share|improve this answer





























              0














              I am not an expert on this topic, but the original solution I came to by reading the FHS specifications, seems to be actually right (or pretty close), I even found this article, which says that the /opt and /usr/local directories are not necessary anymore with the apparition of RPM's, that article says that those directories are now obsolete and make sysadmins' and users' life less easy.



              All my web application is written in PHP, which means that my app does not include any binaries, so I just put all the application programs in /usr/lib. If your application has binaries, you will need /usr/bin or /usr/sbin. I don't either use /usr/share/doc nor /usr/share/man, because my app doesn't include documentation nor manuals (for the moment).



              /var/www is not part of the FHS, so the files located in /var/www/html/appsite can be placed somewhere else, it will depend on how you configure the web server application (Apache, Nginx or other).



              On the other hand, the second approach in the OP is discarded, because it's just lazy and doesn't really try to comply with the FHS.



              So my conclution remains:



              /usr/lib/appname/appsource...
              /etc/appname/appconfiguration...
              /var/www/html/appname/appsite...
              /var/tmp/appname/apptempdata...
              /var/log/appname/applogdata...
              /var/lib/appname/appdata...





              share|improve this answer



























                0












                0








                0







                I am not an expert on this topic, but the original solution I came to by reading the FHS specifications, seems to be actually right (or pretty close), I even found this article, which says that the /opt and /usr/local directories are not necessary anymore with the apparition of RPM's, that article says that those directories are now obsolete and make sysadmins' and users' life less easy.



                All my web application is written in PHP, which means that my app does not include any binaries, so I just put all the application programs in /usr/lib. If your application has binaries, you will need /usr/bin or /usr/sbin. I don't either use /usr/share/doc nor /usr/share/man, because my app doesn't include documentation nor manuals (for the moment).



                /var/www is not part of the FHS, so the files located in /var/www/html/appsite can be placed somewhere else, it will depend on how you configure the web server application (Apache, Nginx or other).



                On the other hand, the second approach in the OP is discarded, because it's just lazy and doesn't really try to comply with the FHS.



                So my conclution remains:



                /usr/lib/appname/appsource...
                /etc/appname/appconfiguration...
                /var/www/html/appname/appsite...
                /var/tmp/appname/apptempdata...
                /var/log/appname/applogdata...
                /var/lib/appname/appdata...





                share|improve this answer















                I am not an expert on this topic, but the original solution I came to by reading the FHS specifications, seems to be actually right (or pretty close), I even found this article, which says that the /opt and /usr/local directories are not necessary anymore with the apparition of RPM's, that article says that those directories are now obsolete and make sysadmins' and users' life less easy.



                All my web application is written in PHP, which means that my app does not include any binaries, so I just put all the application programs in /usr/lib. If your application has binaries, you will need /usr/bin or /usr/sbin. I don't either use /usr/share/doc nor /usr/share/man, because my app doesn't include documentation nor manuals (for the moment).



                /var/www is not part of the FHS, so the files located in /var/www/html/appsite can be placed somewhere else, it will depend on how you configure the web server application (Apache, Nginx or other).



                On the other hand, the second approach in the OP is discarded, because it's just lazy and doesn't really try to comply with the FHS.



                So my conclution remains:



                /usr/lib/appname/appsource...
                /etc/appname/appconfiguration...
                /var/www/html/appname/appsite...
                /var/tmp/appname/apptempdata...
                /var/log/appname/applogdata...
                /var/lib/appname/appdata...






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 25 at 17:34

























                answered Feb 25 at 17:27









                miklmikl

                1655




                1655



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f370408%2fwhere-should-be-located-a-web-application-in-linux%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 check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay