File still unwriteable in /var/www/html after the chmod command
This problem has been settled by command setenforce 0
, which would shut down SELinux.
How silly I am! I never thought about this stuff.
Thanks Flimzy and njd anyway.
Related videos on Youtube
Isabella Martelloni
College student majored in software engineering.
Updated on September 18, 2022Comments
-
Isabella Martelloni over 1 year
I've got some trouble while trying to install some applications on my linux system. It is said that the files in my /var/www/html/xxx directory, where I put them, is not writeable. The command
chmod 777 xxx
has been tried to make it work, but the error remains when I opened the applications again.To be specific, I want to install phpFreeChat on my system, so I put those files in the /var/www/html/freechat directory,
cd
there and typedchmod 777 data/private
,chmod 777 data/public
on bash. Here's the result oflist -al data
:drwxr-xr-x. 4 root root 4096 Jun 17 15:07 . drwxr-xr-x. 13 root root 4096 Jun 17 15:22 .. drwxrwxrwx. 2 root root 4096 Jun 17 15:07 private drwxrwxrwx. 3 root root 4096 Jun 17 15:07 public
These all seemed all right to me, until I typed
http://localhost/freechat
in my browser. Here's the result:phpFreeChat cannot be initialized, please correct these errors:
/var/www/html/freechat/src/../data/private is not writeable /var/www/html/freechat/src/../data/private/cache can't be created /var/www/html/freechat/src/../data/private/cache is not writeable /var/www/html/freechat/src/../data/private/cache is not readable cannot create /var/www/html/freechat/src/../data/public/themes/default cannot create /var/www/html/freechat/src/../data/public/themes/default /var/www/html/freechat/src/../data/private/chat can't be created /var/www/html/freechat/src/../data/private/chat is not writeable /var/www/html/freechat/src/../data/private/chat is not readable /var/www/html/freechat/src/../data/private/chat/s_d0ba868e1391b6c0d897996049a68ada can't be created /var/www/html/freechat/src/../data/private/chat/s_d0ba868e1391b6c0d897996049a68ada is not writeable /var/www/html/freechat/src/../data/private/chat/s_d0ba868e1391b6c0d897996049a68ada is not readable
I'm quite confused with this because this situation did not only happen in the installation of this application but all. Mistakes must be made by me, but what is it?
-
vtest almost 13 yearsDoing chmod 777 is wrong. I suggest you to look into mod_userdir and user directories.
-
-
Isabella Martelloni almost 13 yearsThanks, but the error remains even if I use the recursive method to make it in mode 777.
-
njd almost 13 yearsThem either the
chmod
command didn't work, because you ran it as a normal user, and not as root; or you need to ensure that the preceding directories (/var/www/html/freechat and so on back up to /) are at least searchable (execute flag) by whichever account is used for the httpd service. -
Isabella Martelloni almost 13 years
dr-xr-xr-x
is the/
directory anddrwxr-xr-x
are the others. No x missing in any directory. -
Isabella Martelloni almost 13 yearsThere's a reason to believe that
chmod
command worked for those directories are indeeddrwxrwxrwx
, unlessls -al
cheated me. :) -
Isabella Martelloni almost 13 yearsAnd I've tried
chown
these directories to apache.apache, which is set by/etc/httpd/conf/httpd.conf
. The result didn't change a least.