Apache Read Write Error

I am having issues with folder permissions:

On applications I keep getting the following errors:
Cannot create folder: /var/www/html/fileserver/temp__vp49720pjqi67i0jsci2lljb56/x_message1

When installing roundcube - save errors.. the read :: write permissions are not working.

I have given the whole HTML (and recursive subfolders) 777 permissions. Is there some other settings?
Starquest321Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwniceingCommented:
you install it with root access ?
Did you check the disk space by "df  -h" ?
0
Starquest321Author Commented:
I installed with root access. No issue with disk space.
0
Milind KoyandeCommented:
Is it possible to share the output of
ls -al /var/www/html/
ls -al /var/www/html/fileserver/

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Starquest321Author Commented:
Note that fileserver is a directory within "application"

[root@s360 ~]# ls -al /var/www/html/
total 88
drwxr-xr-x.  4 root root    95 Sep  5 22:55 .
drwxr-xr-x.  4 root root    31 Sep  5 15:35 ..
-rwxr-xr-x.  1 root root    12 Aug 30 19:33 info.php
-rwxr-xr-x.  1 root root 12288 Aug 30 19:35 .info.php.swn
-rwxr-xr-x.  1 root root 12288 Aug 30 19:32 .info.php.swp
drwxrwxr-x. 24 root root 36864 Sep  5 20:22 application
drwxr-xr-x. 11  501   80  4096 Jan  8  2012 webmail


[root@s360 ~]# ls -al /var/www/html/application/fileserver
total 56
drwxrwxr-x.  2 root root     6 Sep  5 20:21 .
drwxrwxr-x. 24 root root 36864 Sep  5 20:22 ..
[root@s360 ~]#
0
Starquest321Author Commented:
Could it be possible that the permissions on that /var/www/html should be set www-data:root?

I am reading it in various forms, but I don't have a user like that. . .

When I try the command:


[root@s360 ~]# chown -R www-data:root /var/www/html/
chown: invalid user: ‘www-data:root’
0
Seth SimmonsSr. Systems AdministratorCommented:
I have given the whole HTML (and recursive subfolders) 777 permissions.

based on your output that doesn't appear to be the case; directory permissions are 755

how is this being installed?  if this is being done through a web site installation (as opposed to command line) then whatever user account is running the apache process should have permissions to that folder structure; right now it's only root
if it's the application folder, then change the permissions appropriately
0
Starquest321Author Commented:
I changed back to 755 permissions since I thought that giving www a 777 would be completely careless and insecure. I don't know how this should be done - so I am stuck.
When my application tries to create a directory it's running into the error:

Cannot create folder: /var/www/html/application/temp__474k3qu2rvfkodoin11rvjjgp3/x_message1

What should be the permissions? How do I know which user is trying to run this? Is this a user different than the mysql user?
0
Starquest321Author Commented:
The installation was done using command line while logged in as 'Root'
0
Starquest321Author Commented:
Just read a post that the user trying to access the "html" is actually apache. . . but my ownership is root. So I changed owership :: group to apache. Still no luck.
0
Seth SimmonsSr. Systems AdministratorCommented:
you changed ownership group?  what about user?
directory permissions are 755 so either you change the user also to apache account or change that folder permission to 775 since group rights are r-w thus can't write there
0
Starquest321Author Commented:
This is the current status now:

Seems like both are apache for user and group. But still no luck:

[root@s ~]# ls -al /var/www/html/
total 88
drwxrwxr-x.  4 apache apache    95 Sep  5 22:55 .
drwxr-xr-x.  4 apache apache    31 Sep  5 15:35 ..
-rwxrwxr-x.  1 apache apache    12 Aug 30 19:33 info.php
-rwxrwxr-x.  1 apache apache 12288 Aug 30 19:35 .info.php.swn
-rwxrwxr-x.  1 apache apache 12288 Aug 30 19:32 .info.php.swp
drwxrwxr-x. 24 apache apache 36864 Sep  5 20:22 application
drwxrwxr-x. 11 apache apache  4096 Jan  8  2012 webmail
0
samriCommented:
HI,

I am just picking this up from the last few msgs;

>> Cannot create folder: /var/www/html/fileserver/temp__vp49720pjqi67i0jsci2lljb56/x_message1

However, from your ls -al listing above, the folder/path "/var/www/html/fileserver/" does not exist. Maybe you need to check your coding on how the file is written.

Quickest thing that I can think of for now would be to creat the folder;
/var/www/html/fileserver/

or,
/var/www/html/fileserver/temp__vp49720pjqi67i0jsci2lljb56/

And make sure the owner is apache, group is apache.
0
Starquest321Author Commented:
I have made sure that there is a directory called Fireserver.
What is the command to achieve the following:

Can you please give me the specific commands to do the following:

1. Change the "application" directory to the group apache (with all files and subfolders)
2. Give apache write permissions

I have an option to do with this with filizilla.  . .but its not saving. Maybe that is where I am going wrong.

Need urgent help
0
Starquest321Author Commented:
I have ran the following command on the box now:

ls -al /var/www/html/


drwxr-x---.  4 apache apache    95 Sep  5 22:55 .
drwxr-xr-x.  4 apache apache    31 Sep  5 15:35 ..
-rwxr-x---.  1 apache apache    12 Aug 30 19:33 info.php
-rwxr-x---.  1 apache apache 12288 Aug 30 19:35 .info.php.swn
-rwxr-x---.  1 apache apache 12288 Aug 30 19:32 .info.php.swp
drwxrwx---. 24 apache apache 36864 Sep  5 20:22 application
drwxr-x---. 11 apache apache  4096 Jan  8  2012 webmail

The directory: application also is owned by user :: group apache
I noticed that only the group has write permission - but not the user.

How can I change that?
0
Seth SimmonsSr. Systems AdministratorCommented:
I have made sure that there is a directory called Fireserver.

i do not see a fileserver folder in that directory listing; only 5 files

I noticed that only the group has write permission - but not the user.

not an issue since the user account is rwx; only need to change if a different user in the same group needed write access
0
Starquest321Author Commented:
The fileserver directory is inside the "application" ...
I get also general errors when trying to create directories:
Cannot create folder: /var/www/html/application/temp__jceqclgkmptva4qnug8bv34vh7/x_voicemail

The error that I get is from file:
http://192.168.197.130/application/useradd.php

How do I know which user is trying to run the script?
0
Starquest321Author Commented:
Could it be possible that the apache is NOT the user that is running the website?

RIght now I have set for all files in the directory:
-rwxrwx---. 1 apache apache  62620 Sep  6 03:53 text.php

So user, group apache can read, write, execute ... but I still cannot create folder. COuld it be the application is not logging on properly?
0
Dejan VasiljevicSys Admin and ProgrammerCommented:
Hi Starquest321,

I saw the almost same problem as this one. The problem might not be in permissions/rights, but the owner. Try to change temp folder to anything else, like temptemp and it will create it with apache rights, and this should solve Your problem about it.

Thanks,

D.
0
Starquest321Author Commented:
I don't have a "temp" folder. I think it created on the fly.
0
Seth SimmonsSr. Systems AdministratorCommented:
Could it be possible that the apache is NOT the user that is running the website?

ps faux | grep httpd

what is the user account listed?
0
Dejan VasiljevicSys Admin and ProgrammerCommented:
Starquest,

That is why I said that You need to create it, because it should be owned by user, not by Apache, and that is why You are getting an error. Create a folder and it will temptemp for temp folder and it will give it ownership to apache.

Thanks,

D.
0
Starquest321Author Commented:
ps faux | grep httpd
root      1080  0.0  1.9 516204 20132 ?        Ss   Sep07   0:05 /usr/sbin/httpd -DFOREGROUND
apache    4436  0.0  0.7 342356  7600 ?        S    05:32   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4438  0.0  1.0 518424 10480 ?        S    05:32   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4439  0.0  1.0 518424 10480 ?        S    05:32   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4441  0.0  1.0 518424 10480 ?        S    05:32   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4442  0.0  3.8 543360 38440 ?        S    05:32   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4551  0.0  1.0 518424 10480 ?        S    05:49   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4554  0.0  3.7 543032 38108 ?        S    05:49   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4555  0.0  1.0 518424 10480 ?        S    05:49   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4556  0.0  1.0 518424 10480 ?        S    05:49   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4557  0.0  1.0 518424 10480 ?        S    05:49   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache    4563  0.0  0.9 518288  9512 ?        S    05:50   0:00  \_ /usr/sbin/httpd -DFOREGROUND
root      4680  0.0  0.0 112640   980 pts/1    S+   06:37   0:00  |       \_ grep --color=auto httpd
0
Starquest321Author Commented:
Dejan: Can you give me specific steps to take?
0
Starquest321Author Commented:
I have created a "new" user .. called "TEMP" to try to solve this issue. Should I put in the group apache to see if this resolves the issue?

The user has "ROOT" rights
0
Dejan VasiljevicSys Admin and ProgrammerCommented:
Starquest321,

Why did You created new user?

Thanks,

D.
0
Starquest321Author Commented:
Trying anything . . .creating the temp did not do the trick
0
Dejan VasiljevicSys Admin and ProgrammerCommented:
Did You or did You not updated anything recently ?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starquest321Author Commented:
Not updated anything. . . and if you tell me which commands to check I will.
0
Dejan VasiljevicSys Admin and ProgrammerCommented:
This is the last message that was probably the solution of this problem and I will post it so the further question have an answer for this, and in future people who search for the same problem could have an example of answer -

"Can You go to Your /tmp folder and create .htaccess file and in there copy this -

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>
# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_flag engine off
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_flag engine off
</IfModule>

or for newer version

# Turn off all options we don't need.
Options None
Options +FollowSymLinks

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

Thanks,

D.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.