apache permission problems
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have some question about permission for my apache.
The following situation came in a test up:
I want to install wordpress and the setup told me that he can not create the file wp-config.php
.
So I noticed that there is a permission problem. But how can I fix this?
All folders in var/www/html are owned by apache:apache and has 755 permissions (drwxr-xr-x).
What information you need to give me some suggestions?
centos apache-httpd
add a comment |Â
up vote
0
down vote
favorite
I have some question about permission for my apache.
The following situation came in a test up:
I want to install wordpress and the setup told me that he can not create the file wp-config.php
.
So I noticed that there is a permission problem. But how can I fix this?
All folders in var/www/html are owned by apache:apache and has 755 permissions (drwxr-xr-x).
What information you need to give me some suggestions?
centos apache-httpd
I think apache runs as httpd user on centos, no ?
â Kiwy
Jun 6 at 9:51
I dunno know really. I installed apache with sudo yum -y apache
â yfain
Jun 6 at 9:55
what is the ouput oflsof -i TCP:80
edit your question so everybody knows also you should add the installation method to your question it could help Also did you created tha apache user ? if you did how did you ?
â Kiwy
Jun 6 at 10:19
lsof command not found
â yfain
Jun 6 at 11:11
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have some question about permission for my apache.
The following situation came in a test up:
I want to install wordpress and the setup told me that he can not create the file wp-config.php
.
So I noticed that there is a permission problem. But how can I fix this?
All folders in var/www/html are owned by apache:apache and has 755 permissions (drwxr-xr-x).
What information you need to give me some suggestions?
centos apache-httpd
I have some question about permission for my apache.
The following situation came in a test up:
I want to install wordpress and the setup told me that he can not create the file wp-config.php
.
So I noticed that there is a permission problem. But how can I fix this?
All folders in var/www/html are owned by apache:apache and has 755 permissions (drwxr-xr-x).
What information you need to give me some suggestions?
centos apache-httpd
edited Jun 6 at 9:21
asked Jun 6 at 8:56
yfain
184
184
I think apache runs as httpd user on centos, no ?
â Kiwy
Jun 6 at 9:51
I dunno know really. I installed apache with sudo yum -y apache
â yfain
Jun 6 at 9:55
what is the ouput oflsof -i TCP:80
edit your question so everybody knows also you should add the installation method to your question it could help Also did you created tha apache user ? if you did how did you ?
â Kiwy
Jun 6 at 10:19
lsof command not found
â yfain
Jun 6 at 11:11
add a comment |Â
I think apache runs as httpd user on centos, no ?
â Kiwy
Jun 6 at 9:51
I dunno know really. I installed apache with sudo yum -y apache
â yfain
Jun 6 at 9:55
what is the ouput oflsof -i TCP:80
edit your question so everybody knows also you should add the installation method to your question it could help Also did you created tha apache user ? if you did how did you ?
â Kiwy
Jun 6 at 10:19
lsof command not found
â yfain
Jun 6 at 11:11
I think apache runs as httpd user on centos, no ?
â Kiwy
Jun 6 at 9:51
I think apache runs as httpd user on centos, no ?
â Kiwy
Jun 6 at 9:51
I dunno know really. I installed apache with sudo yum -y apache
â yfain
Jun 6 at 9:55
I dunno know really. I installed apache with sudo yum -y apache
â yfain
Jun 6 at 9:55
what is the ouput of
lsof -i TCP:80
edit your question so everybody knows also you should add the installation method to your question it could help Also did you created tha apache user ? if you did how did you ?â Kiwy
Jun 6 at 10:19
what is the ouput of
lsof -i TCP:80
edit your question so everybody knows also you should add the installation method to your question it could help Also did you created tha apache user ? if you did how did you ?â Kiwy
Jun 6 at 10:19
lsof command not found
â yfain
Jun 6 at 11:11
lsof command not found
â yfain
Jun 6 at 11:11
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
You should allow the user on which privileges apache process is running to write to this file.
To check the name of user used by apache process you can run ps -ef | grep httpd
and then set the owner for wp-config.php
file but after installation will be finished you should disallow apache to make changes on this file.
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
I use CGI for PHP
â yfain
Jun 6 at 9:16
 |Â
show 4 more comments
up vote
0
down vote
we need to temporarily grant httpd_sys_rw_content_t
to the WordPress directory. This is to allow the initial wizard to create the wp-config.php
file.
sudo chcon -t httpd_sys_rw_content_t /var/www/html/wordpress/
Now you can run the wizard and it will work properly.
Once your site is set up, restore the context to http_sys_content_t
sudo restorecon -v /var/www/html/wordpress/
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You should allow the user on which privileges apache process is running to write to this file.
To check the name of user used by apache process you can run ps -ef | grep httpd
and then set the owner for wp-config.php
file but after installation will be finished you should disallow apache to make changes on this file.
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
I use CGI for PHP
â yfain
Jun 6 at 9:16
 |Â
show 4 more comments
up vote
0
down vote
You should allow the user on which privileges apache process is running to write to this file.
To check the name of user used by apache process you can run ps -ef | grep httpd
and then set the owner for wp-config.php
file but after installation will be finished you should disallow apache to make changes on this file.
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
I use CGI for PHP
â yfain
Jun 6 at 9:16
 |Â
show 4 more comments
up vote
0
down vote
up vote
0
down vote
You should allow the user on which privileges apache process is running to write to this file.
To check the name of user used by apache process you can run ps -ef | grep httpd
and then set the owner for wp-config.php
file but after installation will be finished you should disallow apache to make changes on this file.
You should allow the user on which privileges apache process is running to write to this file.
To check the name of user used by apache process you can run ps -ef | grep httpd
and then set the owner for wp-config.php
file but after installation will be finished you should disallow apache to make changes on this file.
answered Jun 6 at 9:08
mariaczi
42915
42915
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
I use CGI for PHP
â yfain
Jun 6 at 9:16
 |Â
show 4 more comments
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
I use CGI for PHP
â yfain
Jun 6 at 9:16
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
Thanks, but I need a solution that this will work for new folders and domains. I changed the owner to apache:apache for var/www/html/ and 755. But it is also not working.
â yfain
Jun 6 at 9:09
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
You changed permission for /var/www/html directory but what with files and sub-directories inside?
â mariaczi
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
Also changed to this.
â yfain
Jun 6 at 9:13
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
OK, you use mod_php with apache or php-fpm?
â mariaczi
Jun 6 at 9:14
I use CGI for PHP
â yfain
Jun 6 at 9:16
I use CGI for PHP
â yfain
Jun 6 at 9:16
 |Â
show 4 more comments
up vote
0
down vote
we need to temporarily grant httpd_sys_rw_content_t
to the WordPress directory. This is to allow the initial wizard to create the wp-config.php
file.
sudo chcon -t httpd_sys_rw_content_t /var/www/html/wordpress/
Now you can run the wizard and it will work properly.
Once your site is set up, restore the context to http_sys_content_t
sudo restorecon -v /var/www/html/wordpress/
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
add a comment |Â
up vote
0
down vote
we need to temporarily grant httpd_sys_rw_content_t
to the WordPress directory. This is to allow the initial wizard to create the wp-config.php
file.
sudo chcon -t httpd_sys_rw_content_t /var/www/html/wordpress/
Now you can run the wizard and it will work properly.
Once your site is set up, restore the context to http_sys_content_t
sudo restorecon -v /var/www/html/wordpress/
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
add a comment |Â
up vote
0
down vote
up vote
0
down vote
we need to temporarily grant httpd_sys_rw_content_t
to the WordPress directory. This is to allow the initial wizard to create the wp-config.php
file.
sudo chcon -t httpd_sys_rw_content_t /var/www/html/wordpress/
Now you can run the wizard and it will work properly.
Once your site is set up, restore the context to http_sys_content_t
sudo restorecon -v /var/www/html/wordpress/
we need to temporarily grant httpd_sys_rw_content_t
to the WordPress directory. This is to allow the initial wizard to create the wp-config.php
file.
sudo chcon -t httpd_sys_rw_content_t /var/www/html/wordpress/
Now you can run the wizard and it will work properly.
Once your site is set up, restore the context to http_sys_content_t
sudo restorecon -v /var/www/html/wordpress/
answered Jun 6 at 9:50
SivaPrasath
4,32712141
4,32712141
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
add a comment |Â
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
Is there a way to enable this always?
â yfain
Jun 6 at 9:51
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
then don't restore the context.
â SivaPrasath
Jun 6 at 9:57
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448130%2fapache-permission-problems%23new-answer', 'question_page');
);
Post as a guest
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
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
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
I think apache runs as httpd user on centos, no ?
â Kiwy
Jun 6 at 9:51
I dunno know really. I installed apache with sudo yum -y apache
â yfain
Jun 6 at 9:55
what is the ouput of
lsof -i TCP:80
edit your question so everybody knows also you should add the installation method to your question it could help Also did you created tha apache user ? if you did how did you ?â Kiwy
Jun 6 at 10:19
lsof command not found
â yfain
Jun 6 at 11:11