Apache Server setup issuePermissions for Apache and FTPd usersHow to set up file permissions/ownership for...

Transform the partial differential equation with new independent variables

Why doesn't the Earth's acceleration towards the Moon accumulate to push the Earth off its orbit?

How to properly maintain eye contact with people that have distinct facial features?

What are the problems in teaching guitar via Skype?

Which noble houses were destroyed during the Game of Thrones?

File globbing pattern, !(*example), behaves differently in bash script than it does in bash shell

What's the connection between "kicking a pigeon" and "how a bill becomes a law"?

Question about exercise 11.5 in TeXbook

Yandex Programming Contest: Alarms

Leading and Suffering Numbers

Draw a checker pattern with a black X in the center

Why colon to denote that a value belongs to a type?

Is this story about US tax office reasonable?

How to make { and } automatically have left and right

Split polygon using another polygon in QGIS

Is there an explanation for Austria's Freedom Party virtually retaining its vote share despite recent scandal?

1960s sci-fi novella with a character who is treated as invisible by being ignored

Is there any use case for the bottom type as a function parameter type?

How can I find where certain bash function is defined?

Black-and-white film where monster/alien gets fried

Smart people send dumb people to a new planet on a space craft that crashes into a body of water

What does uniform continuity mean exactly?

Comment dit-on « I’ll tell you what » ?

The Passive Wisdom (Perception) score of my character on D&D Beyond seems too high



Apache Server setup issue


Permissions for Apache and FTPd usersHow to set up file permissions/ownership for FTP/Apache/PHP on CentOSAllow user access to their own dir, /var/www/html, nothing elseHow do I get SFTP/FTP setupChange default Document Root path in cent os 7Apache is not starting upApache PHP uploads - ownership and permissionsHow to change group for apache user in FedoraCant get sftp to work with var/www folderpermit ftp user to write in /var/www folder with pure-ftpd






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







0















I have installed and configured apache on RedHat 7 Image on AWS. But I have issues with permissions/ownership while uploading files by ssh using filezilla.



I Setup a ssh user and added its home dir to apache /var/www/html/ and installed Magento on it.



Original Setup:




  1. User:Group of /var/www/html/ is apache

  2. User: root / Group: apache for /var/lib/php/session dir(not sure but I think magento stores session files there as well as i get write error when owner is changed)

  3. httpd.conf User:Group is apache

  4. With these settings, cannot upload files with ftp or sftp - permission error.


When I changed to:




  1. User:Group of /var/www/html/ is ssh_user

  2. User: ssh_user / Group: ssh_user for /var/lib/php/session dir

  3. httpd.conf User:Group is ssh_user

  4. With these, i was able to upload but cache files are generated as root.


What I want is:




  1. User:Group of /var/www/html/ is ssh_user

  2. Default settings for /var/lib/php/session dir

  3. httpd.conf User:Group is apache


I want to be able to upload files through ftp or sftp by regular user.



How do i acheive this? This is the first time i have setup apache so just trying to learn how to do it right way.










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    0















    I have installed and configured apache on RedHat 7 Image on AWS. But I have issues with permissions/ownership while uploading files by ssh using filezilla.



    I Setup a ssh user and added its home dir to apache /var/www/html/ and installed Magento on it.



    Original Setup:




    1. User:Group of /var/www/html/ is apache

    2. User: root / Group: apache for /var/lib/php/session dir(not sure but I think magento stores session files there as well as i get write error when owner is changed)

    3. httpd.conf User:Group is apache

    4. With these settings, cannot upload files with ftp or sftp - permission error.


    When I changed to:




    1. User:Group of /var/www/html/ is ssh_user

    2. User: ssh_user / Group: ssh_user for /var/lib/php/session dir

    3. httpd.conf User:Group is ssh_user

    4. With these, i was able to upload but cache files are generated as root.


    What I want is:




    1. User:Group of /var/www/html/ is ssh_user

    2. Default settings for /var/lib/php/session dir

    3. httpd.conf User:Group is apache


    I want to be able to upload files through ftp or sftp by regular user.



    How do i acheive this? This is the first time i have setup apache so just trying to learn how to do it right way.










    share|improve this question
















    bumped to the homepage by Community 1 hour ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I have installed and configured apache on RedHat 7 Image on AWS. But I have issues with permissions/ownership while uploading files by ssh using filezilla.



      I Setup a ssh user and added its home dir to apache /var/www/html/ and installed Magento on it.



      Original Setup:




      1. User:Group of /var/www/html/ is apache

      2. User: root / Group: apache for /var/lib/php/session dir(not sure but I think magento stores session files there as well as i get write error when owner is changed)

      3. httpd.conf User:Group is apache

      4. With these settings, cannot upload files with ftp or sftp - permission error.


      When I changed to:




      1. User:Group of /var/www/html/ is ssh_user

      2. User: ssh_user / Group: ssh_user for /var/lib/php/session dir

      3. httpd.conf User:Group is ssh_user

      4. With these, i was able to upload but cache files are generated as root.


      What I want is:




      1. User:Group of /var/www/html/ is ssh_user

      2. Default settings for /var/lib/php/session dir

      3. httpd.conf User:Group is apache


      I want to be able to upload files through ftp or sftp by regular user.



      How do i acheive this? This is the first time i have setup apache so just trying to learn how to do it right way.










      share|improve this question
















      I have installed and configured apache on RedHat 7 Image on AWS. But I have issues with permissions/ownership while uploading files by ssh using filezilla.



      I Setup a ssh user and added its home dir to apache /var/www/html/ and installed Magento on it.



      Original Setup:




      1. User:Group of /var/www/html/ is apache

      2. User: root / Group: apache for /var/lib/php/session dir(not sure but I think magento stores session files there as well as i get write error when owner is changed)

      3. httpd.conf User:Group is apache

      4. With these settings, cannot upload files with ftp or sftp - permission error.


      When I changed to:




      1. User:Group of /var/www/html/ is ssh_user

      2. User: ssh_user / Group: ssh_user for /var/lib/php/session dir

      3. httpd.conf User:Group is ssh_user

      4. With these, i was able to upload but cache files are generated as root.


      What I want is:




      1. User:Group of /var/www/html/ is ssh_user

      2. Default settings for /var/lib/php/session dir

      3. httpd.conf User:Group is apache


      I want to be able to upload files through ftp or sftp by regular user.



      How do i acheive this? This is the first time i have setup apache so just trying to learn how to do it right way.







      permissions apache-httpd sftp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 18 '17 at 19:38









      Jeff Schaller

      45.9k1165150




      45.9k1165150










      asked Apr 18 '17 at 17:50









      Syed MudabbirSyed Mudabbir

      238




      238





      bumped to the homepage by Community 1 hour ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 1 hour ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Please check your apache httpd.conf. There you can see ServerRoot and ServerAdmin as well. There, you will be having:



          ServerRoot "/etc/httpd"
          ServerAdmin root@localhost


          Access permissions to server installation or configuration must be root as shown above and not suggested to modify.



          But, For docroot location which usually /var/www/html, User and group will be apache. It can be changed to any other user except root. It is important to change the owner for docroot or DocumentRoot directory location which is /var/www/ or /var/www/html with either apache or any other not root user.
          You can change it to user of your choice. root is not suggested to set as user and group in httpd.conf



          User apache
          Group apache


          make sure you must change the owner of docroot directory with the same user as mentioned in httpd.conf.By default the user and group are apache.
          So, you will need to change the owner of docroot directory /var/www/html to apache as shown below:



          sudo chown -vR apache. /var/www/html


          Now your website pages will start to create cache whenever you visit a webpage loaded by apache.



          In your scenario, As you are using and ssh_user as user, You can set User:Group your desired directory location and all its internal hierarchy, for.eg., for the path /var/www/html/, then you can make it with below command.



          Syntax: sudo chown -vR username:groupname {path-of-directory-location}



          sudo chown -vR ssh_user:ssh_user /var/www/html
          sudo chown -vR apache:apache /var/lib/php/session


          If you want to be able to upload or transfer files through ftp or sftp by regular user., You can use any of either FileZilla Server or WinSCP, it is suggested to login with the user owning the directory and then transfer the files.



          Make sure if you have either user or group permissions to the directory you are trying to access.






          share|improve this answer


























          • The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

            – Syed Mudabbir
            Apr 18 '17 at 20:45











          • @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

            – Srikanth Popuri
            Apr 18 '17 at 20:55














          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%2f359747%2fapache-server-setup-issue%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














          Please check your apache httpd.conf. There you can see ServerRoot and ServerAdmin as well. There, you will be having:



          ServerRoot "/etc/httpd"
          ServerAdmin root@localhost


          Access permissions to server installation or configuration must be root as shown above and not suggested to modify.



          But, For docroot location which usually /var/www/html, User and group will be apache. It can be changed to any other user except root. It is important to change the owner for docroot or DocumentRoot directory location which is /var/www/ or /var/www/html with either apache or any other not root user.
          You can change it to user of your choice. root is not suggested to set as user and group in httpd.conf



          User apache
          Group apache


          make sure you must change the owner of docroot directory with the same user as mentioned in httpd.conf.By default the user and group are apache.
          So, you will need to change the owner of docroot directory /var/www/html to apache as shown below:



          sudo chown -vR apache. /var/www/html


          Now your website pages will start to create cache whenever you visit a webpage loaded by apache.



          In your scenario, As you are using and ssh_user as user, You can set User:Group your desired directory location and all its internal hierarchy, for.eg., for the path /var/www/html/, then you can make it with below command.



          Syntax: sudo chown -vR username:groupname {path-of-directory-location}



          sudo chown -vR ssh_user:ssh_user /var/www/html
          sudo chown -vR apache:apache /var/lib/php/session


          If you want to be able to upload or transfer files through ftp or sftp by regular user., You can use any of either FileZilla Server or WinSCP, it is suggested to login with the user owning the directory and then transfer the files.



          Make sure if you have either user or group permissions to the directory you are trying to access.






          share|improve this answer


























          • The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

            – Syed Mudabbir
            Apr 18 '17 at 20:45











          • @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

            – Srikanth Popuri
            Apr 18 '17 at 20:55


















          0














          Please check your apache httpd.conf. There you can see ServerRoot and ServerAdmin as well. There, you will be having:



          ServerRoot "/etc/httpd"
          ServerAdmin root@localhost


          Access permissions to server installation or configuration must be root as shown above and not suggested to modify.



          But, For docroot location which usually /var/www/html, User and group will be apache. It can be changed to any other user except root. It is important to change the owner for docroot or DocumentRoot directory location which is /var/www/ or /var/www/html with either apache or any other not root user.
          You can change it to user of your choice. root is not suggested to set as user and group in httpd.conf



          User apache
          Group apache


          make sure you must change the owner of docroot directory with the same user as mentioned in httpd.conf.By default the user and group are apache.
          So, you will need to change the owner of docroot directory /var/www/html to apache as shown below:



          sudo chown -vR apache. /var/www/html


          Now your website pages will start to create cache whenever you visit a webpage loaded by apache.



          In your scenario, As you are using and ssh_user as user, You can set User:Group your desired directory location and all its internal hierarchy, for.eg., for the path /var/www/html/, then you can make it with below command.



          Syntax: sudo chown -vR username:groupname {path-of-directory-location}



          sudo chown -vR ssh_user:ssh_user /var/www/html
          sudo chown -vR apache:apache /var/lib/php/session


          If you want to be able to upload or transfer files through ftp or sftp by regular user., You can use any of either FileZilla Server or WinSCP, it is suggested to login with the user owning the directory and then transfer the files.



          Make sure if you have either user or group permissions to the directory you are trying to access.






          share|improve this answer


























          • The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

            – Syed Mudabbir
            Apr 18 '17 at 20:45











          • @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

            – Srikanth Popuri
            Apr 18 '17 at 20:55
















          0












          0








          0







          Please check your apache httpd.conf. There you can see ServerRoot and ServerAdmin as well. There, you will be having:



          ServerRoot "/etc/httpd"
          ServerAdmin root@localhost


          Access permissions to server installation or configuration must be root as shown above and not suggested to modify.



          But, For docroot location which usually /var/www/html, User and group will be apache. It can be changed to any other user except root. It is important to change the owner for docroot or DocumentRoot directory location which is /var/www/ or /var/www/html with either apache or any other not root user.
          You can change it to user of your choice. root is not suggested to set as user and group in httpd.conf



          User apache
          Group apache


          make sure you must change the owner of docroot directory with the same user as mentioned in httpd.conf.By default the user and group are apache.
          So, you will need to change the owner of docroot directory /var/www/html to apache as shown below:



          sudo chown -vR apache. /var/www/html


          Now your website pages will start to create cache whenever you visit a webpage loaded by apache.



          In your scenario, As you are using and ssh_user as user, You can set User:Group your desired directory location and all its internal hierarchy, for.eg., for the path /var/www/html/, then you can make it with below command.



          Syntax: sudo chown -vR username:groupname {path-of-directory-location}



          sudo chown -vR ssh_user:ssh_user /var/www/html
          sudo chown -vR apache:apache /var/lib/php/session


          If you want to be able to upload or transfer files through ftp or sftp by regular user., You can use any of either FileZilla Server or WinSCP, it is suggested to login with the user owning the directory and then transfer the files.



          Make sure if you have either user or group permissions to the directory you are trying to access.






          share|improve this answer















          Please check your apache httpd.conf. There you can see ServerRoot and ServerAdmin as well. There, you will be having:



          ServerRoot "/etc/httpd"
          ServerAdmin root@localhost


          Access permissions to server installation or configuration must be root as shown above and not suggested to modify.



          But, For docroot location which usually /var/www/html, User and group will be apache. It can be changed to any other user except root. It is important to change the owner for docroot or DocumentRoot directory location which is /var/www/ or /var/www/html with either apache or any other not root user.
          You can change it to user of your choice. root is not suggested to set as user and group in httpd.conf



          User apache
          Group apache


          make sure you must change the owner of docroot directory with the same user as mentioned in httpd.conf.By default the user and group are apache.
          So, you will need to change the owner of docroot directory /var/www/html to apache as shown below:



          sudo chown -vR apache. /var/www/html


          Now your website pages will start to create cache whenever you visit a webpage loaded by apache.



          In your scenario, As you are using and ssh_user as user, You can set User:Group your desired directory location and all its internal hierarchy, for.eg., for the path /var/www/html/, then you can make it with below command.



          Syntax: sudo chown -vR username:groupname {path-of-directory-location}



          sudo chown -vR ssh_user:ssh_user /var/www/html
          sudo chown -vR apache:apache /var/lib/php/session


          If you want to be able to upload or transfer files through ftp or sftp by regular user., You can use any of either FileZilla Server or WinSCP, it is suggested to login with the user owning the directory and then transfer the files.



          Make sure if you have either user or group permissions to the directory you are trying to access.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 21 '17 at 11:59

























          answered Apr 18 '17 at 20:36









          Srikanth PopuriSrikanth Popuri

          12




          12













          • The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

            – Syed Mudabbir
            Apr 18 '17 at 20:45











          • @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

            – Srikanth Popuri
            Apr 18 '17 at 20:55





















          • The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

            – Syed Mudabbir
            Apr 18 '17 at 20:45











          • @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

            – Srikanth Popuri
            Apr 18 '17 at 20:55



















          The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

          – Syed Mudabbir
          Apr 18 '17 at 20:45





          The issue here was /var/www/html is owned by apache(user/group=apache) so I am unable to upload by ftp using regular users. So root@localhost change to ssh_user@localhost?

          – Syed Mudabbir
          Apr 18 '17 at 20:45













          @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

          – Srikanth Popuri
          Apr 18 '17 at 20:55







          @SyedMudabbir It is always suggested to perform apache using root only. It is also fine if a root user and apache are members of a same group. But again group level permissions must be proper

          – Srikanth Popuri
          Apr 18 '17 at 20:55




















          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%2f359747%2fapache-server-setup-issue%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

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...