Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - wshosted

Pages: [1] 2
1
PHP / Re: php cron job, account vs root
« on: January 27, 2021, 12:51:14 PM »
So apparently good news/bad news. Good news first: the suggestion to use
Code: [Select]
sudo -u username user-accessible-path-to-php php-script worked! The bad news, sounds like both of you feel that is not a good idea.

Since I have very limit unix experience, I have spent a couple of days trying to wrap my head around why it is a bad idea. The best I have come up with so far is: running the php script as "sudo - u user1" would elevate any inserted malicious code or mistakes I have made in the coding to root status and create a potentially explosive situation?

Let me as quickly as possible explain what I am attempting. Running WordPress sites, I wanted to make the majority of the files in the installation immutable using chattr +i, except of course for those areas that require being writable. So I am using a few lines in a bash script to get the right mix of locked files.

I have also created a php script that will run the WP auto update process that lives in the  public_html folder, because thus far that's the only way I have been successful at running the php WP update process.

Creating a root based cron to run the bash and a user account cron to run the php script works, BUT requires a root cron entry to unlock, and another to relock the files and coordinating the timing between the three.

I wanted to combine all three processes into a single fully automated process via a single cron that will:

1) unlock the WP installation (via a single bash line)
2) update WP by running the php script (currently sudo based)
3) relock the WP installation (via a multi-line bash script)

Using the sudo method on step two works perfectly, all three functions happen in order and require no timing coordination and is a very fast process.

Am I just barking up the wrong tree or is there a way to safely combine these bash/php functions?

I have for what I thought were safety reasons, avoided making shell_exec available at the user account level.

2
PHP / Re: php cron job, account vs root
« on: January 25, 2021, 11:50:02 AM »
Quote
Nothing to do with CWP - just plain lack of *nix knowledge.
Absolutely correct both on description of the person and the problem. Any suggestions on a good *nix knowledge source/tutorial.

A windows person that has been using shared hosting forever, but obviously in need of real *nix knowledge now. Willing to learn.

Thanks for the helping hand!

3
PHP / php cron job, account vs root
« on: January 25, 2021, 01:41:59 AM »
I have a php script that I can execute from a browser and also as a cron job using the account's cron, however I cannot execute from the terminal window or root cron job.

The script is located in the public_html folder of the account.

Why can I not execute the script from the terminal window and root cron?

4
CentOS 7 Problems / Re: Run shell script in cron
« on: January 22, 2021, 12:44:47 PM »
Issue resolved, I was incorrect that the script was executing from the terminal window. Fixed script and it now works fine in cron.

5
CentOS 7 Problems / Run shell script in cron
« on: January 22, 2021, 12:43:46 AM »
I have tried several methods, but so far unable to run a shell script as a cwp cron job.

The script works fine when called from the terminal screen.

6
Aplications / Re: WordPress Page Update - 403 Forbidden
« on: January 18, 2021, 04:31:23 PM »
When I faced some of these same type issues, I found there was an endless supply of rule IDs to fix in modsec. I saw a note somewhere that switching to Comodo WAF in modsec would solve that issue and indeed it did.

7
Aplications / WordPress and immutable files
« on: January 18, 2021, 01:32:21 PM »
I have been hosting with Scala Hosting for awhile and they have a feature that locks down WordPress files, as best I can tell they are using the chattr command to make files immutable. It is obvious that they are very selective with the process because I never have issues with WordFence and other plugins that require the ability to write to their own files.

Does anyone have a list or suggestions on files that can safely be made immutable? Or the opposite, those that cannot be made immutable?

8
I would swear I had tried that, but lo and behold, you are absolutely correct. Thanks!

9
Backup / Re: User Full Account Backup is Not Working
« on: December 18, 2020, 12:47:54 AM »
Same here, using the manual "full backup" gets everything EXCEPT home.

I assume the intent is to backup everything including the home folder?

10
CentOS-WebPanel GUI / Re: Admin panel theme tweak
« on: December 15, 2020, 05:21:33 PM »
Thank you!

11
CentOS-WebPanel GUI / US date format
« on: December 15, 2020, 01:19:16 AM »
Is there an option I am missing that would revert dates in the admin and user panels, especially the file manager, to US format (mm/dd/yyyy) ?

12
Has this been fixed?

13
I've been attempting to make the reseller work for me, this time I am finding that the nameserver section within the reseller module is totally blank except for a spinner, I have given it time and nothing ever happens. Other tabs show things as expected, except this one. Bug or bad config on my part?

14
After some searching, discovered the /home/<usrname>/.conf/cwp.ini file looked different than a couple of other subaccounts in the reseller setup. After changing the details to look like the other accounts I was once again able to login to the subaccount in question.

The cwi.ini contained the following:
Code: [Select]
LANG=en
THEME=original
EMAIL=SESSIONTIME=3600
LISTROW=10
SOUNDALERT=0
GOOGLEFA=0

This is what I copied in to recover the account:
Code: [Select]
LANG=en
THEME=original
EMAIL=

Possibly there is a bug in the 2FA process related to reseller subaccounts?

15
Sorry, I'm not sure what that means?

Pages: [1] 2