[Resolved] Permissions issues with new accounts

Status
Not open for further replies.

sahostking

Well-Known Member
#1
Hi,

We installed Litespeed yesterday and now have issues when creating new accounts via cpanel. Clients always get 404 page even though they place default doc files or websites in their www or public_html folders. Below is how it looks usually as an example:
Code:
4.0K drwxr-x---    5 lehumogr lehumogr 4.0K Nov  3 07:25 public_html/
When we change it to, user.nobody then it works fine:

Code:
4.0K drwxr-x---    5 lehumogr nobody 4.0K Nov  3 07:25 public_html/
How do we automate this so we do not have to manually perform it each time?

Thanks
 
Last edited by a moderator:

sahostking

Well-Known Member
#3
I followed that and also disabled FileProtect as many posts point to that.

I still cannot serve any files in intial creation of a cpanel account until I manually change ownership permissions as per above. I'm geting this in logs when loading it and recieving 404 errors:

Code:
2014-11-04 12:59:03.373 [ERROR] [HTAccess] Failed to open [/home/mastercu/public_html/.htaccess]: Permission denied
2014-11-04 12:59:03.373 [INFO] [IP address:53981-0#APVH_domainname.com] Index file is not available in [/home/mastercu/public_html/]
2014-11-04 12:59:03.373 [INFO] [IP address:53981-0#APVH_domainname.com] File not found [/home/mastercu/public_html/404.shtml]
 
Last edited by a moderator:

sahostking

Well-Known Member
#6
Hi,

Figured something out. If I set the folder to use 755 public_html then all works well.

It looks like this initially when an account is created:
Code:
drwxr-x---    3 skylensc skylensc 4.0K Nov  4 06:03 public_html/
But when I chmod 755 public_html/ then it looks like this and works:
Code:
drwxr-xr-x    3 skylensc skylensc 4.0K Nov  4 06:03 public_html/
How do I automate this in Litespeed admin.

I'm thinking it's something here, but not sure.
Code:
File Access      Edit
Follow Symbolic Link  Yes
Check Symbolic Link   No
Force Strict Ownership   Yes
Required Permission Mask   000
Restricted Permission Mask   000
Script Restricted Permission Mask  002
Script Restricted Directory Permission Mask   002
Sorry for the trouble and thanks again.
 
Last edited by a moderator:

NiteWave

Administrator
#7
It looks like this initially when an account is created:

Code:
drwxr-x--- 3 skylensc skylensc 4.0K Nov 4 06:03 public_html/
this is problem. should be
Code:
drwxr-x--- 3 skylensc nobody 4.0K Nov 4 06:03 public_html/
if this initial issue is resolved, rest issues will be gone.

you can also ask cPanel's support regarding this.

please try switch to apache, create a new test user account, check public_html's ownership and permission until it's correct. then switch to lsws -- the issue should be gone as well, since public_html is managed by WHM/cPanel, not litespeed or apache.
 
Last edited by a moderator:

sahostking

Well-Known Member
#8
When I switched back to apache and retried it had the same problem.

When I ran /scripts/upcp --force and reran easy apache again it didn't work.
I decided to uninstall litespeed and rerun easy apache again and it started working again.

I then was a bit confused so decided to reinstall litespeed again and same issue occured.
I reran /scripts/upcp --force and easyapache and same issue again.

So only when I uninstall litespeed completely and redun easyapache all works.

Wish I could figure this out really want litespeed :)
 

sahostking

Well-Known Member
#9
Gave this another try with the same thing happening.

But this time I created an account and noticed the incorrect permissions as per above.

I then decided to run easy apache with File Protect off and same thing.
I then reran Easyapache again with it on and permissions were corrected on that account and I was very hopeful.

However when creating a new account I sat with the same issue once more. :/
 

sahostking

Well-Known Member
#10
cPanel fixed this for me even though apache was run with fileprotect some file was missing. Message as per below:

Since you are currently using SuPHP and SuExec, the correct permissions of your public_html directory should be 750, with the ownership user.nobody. This appears to be creating incorrect as file protect is disabled.

I proceeded to enable this for new accounts by creating the below file:
Code:
[03:53:05 lin01 root@5695291 /home]cPs# touch /var/cpanel/fileprotect
[03:53:11 lin01 root@5695291 /home]cPs#

After doing this, I attempted to create a test account and can verify the public_html directory was created with the correct ownership.
 
Last edited by a moderator:

sahostking

Well-Known Member
#12
Yes and then it works fine.

One issue though seems to be that when one runs easyapache again it removes this file and I have to recreate it to get everything working again.
 

sahostking

Well-Known Member
#13
Here is the issue. When litespeed restarts or your switch between litespeed and easyapache and back again you get this:
Code:
    Apache Stopped.
    fileprotect removed, not needed by LiteSpeed
    2015-01-04 22:42:27.052 [NOTICE] Memory size is: 8031296KB.
    [OK] litespeed: pid=870519.
    LiteSpeed started successfully.
    Apache port offset has been set to 0.
That is when all the trouble starts. Litespeed thinks fileprotect should not be there then breaks new permissions on folders.
If easyapache is run thereafter though it fixes it.
 
Last edited by a moderator:

mistwang

LiteSpeed Staff
#14
Can you tell us more about the permission problem?

fileprotect removed feature is recommended by cpanel to deal with permission problem when ruid2 is enabled?

do you have ruid2 enabled in easyApache?
 

sahostking

Well-Known Member
#15
no ruid2 enabled. I only always used suPHP and Mod worker. Nothing else. Until litespeed now. This only happens when I switch between apache to litespeed.
 

mistwang

LiteSpeed Staff
#16
This problem should have been fixed now, please force reinstall 4.2.20, run command
Code:
touch /var/cpanel/fileprotect
 
Last edited by a moderator:
Status
Not open for further replies.
Top