Apache Server setup issue
Clash Royale CLAN TAG#URR8PPP
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:
- User:Group of /var/www/html/ is apache
- 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)
- httpd.conf User:Group is apache
- With these settings, cannot upload files with ftp or sftp - permission error.
When I changed to:
- User:Group of /var/www/html/ is ssh_user
- User: ssh_user / Group: ssh_user for /var/lib/php/session dir
- httpd.conf User:Group is ssh_user
- With these, i was able to upload but cache files are generated as root.
What I want is:
- User:Group of /var/www/html/ is ssh_user
- Default settings for /var/lib/php/session dir
- 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
add a comment |
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:
- User:Group of /var/www/html/ is apache
- 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)
- httpd.conf User:Group is apache
- With these settings, cannot upload files with ftp or sftp - permission error.
When I changed to:
- User:Group of /var/www/html/ is ssh_user
- User: ssh_user / Group: ssh_user for /var/lib/php/session dir
- httpd.conf User:Group is ssh_user
- With these, i was able to upload but cache files are generated as root.
What I want is:
- User:Group of /var/www/html/ is ssh_user
- Default settings for /var/lib/php/session dir
- 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
add a comment |
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:
- User:Group of /var/www/html/ is apache
- 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)
- httpd.conf User:Group is apache
- With these settings, cannot upload files with ftp or sftp - permission error.
When I changed to:
- User:Group of /var/www/html/ is ssh_user
- User: ssh_user / Group: ssh_user for /var/lib/php/session dir
- httpd.conf User:Group is ssh_user
- With these, i was able to upload but cache files are generated as root.
What I want is:
- User:Group of /var/www/html/ is ssh_user
- Default settings for /var/lib/php/session dir
- 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
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:
- User:Group of /var/www/html/ is apache
- 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)
- httpd.conf User:Group is apache
- With these settings, cannot upload files with ftp or sftp - permission error.
When I changed to:
- User:Group of /var/www/html/ is ssh_user
- User: ssh_user / Group: ssh_user for /var/lib/php/session dir
- httpd.conf User:Group is ssh_user
- With these, i was able to upload but cache files are generated as root.
What I want is:
- User:Group of /var/www/html/ is ssh_user
- Default settings for /var/lib/php/session dir
- 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
permissions apache-httpd sftp
edited Apr 18 '17 at 19:38
Jeff Schaller
41.3k1056131
41.3k1056131
asked Apr 18 '17 at 17:50
Syed MudabbirSyed Mudabbir
237
237
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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