• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question What is equivalent to Apache's www-data user in Plesk?

LionKing

Regular Pleskian
Server operating system version
Ubuntu Linux
Plesk version and microupdate number
18.048
Hello everyone.
I'm new user to Plesk used just raw servers (windows/Linux), and C-panel in the past, but decided to try Plesk out for our company environment.

I'm trying to figure out and i have been searching for the answer of what is the equivalent web server user in Plesk to Apahce's "www-user".

I need to know it to run some maintenance commands on some of some of our web apps which runs the PHP Laravel framework. Using the common commands in Linux with www-data will obviously not work so I would be grateful for the help in enlightening me of this.

Thanks in advance.
Kind regards
 
I assume you are using "Subsriptions" in Plesk as that is the most common setup. Each subscription has an owner, a system user. All files and directories of a subscription are owned by that system user, and files that shall be processed by the web server have the group "psacln". The document root directory of a website has the group "psaserv".
Here is more that might help you with this topic:
 
Thanks for your reply Peter and the information provided.

So in the past on my Linux servers and lets say i wanted to run this maintenance command after upgrade I would usually type something like:

cd /home/www/folder-xyz/public_html
sudo -u www-data php artisan migrate


and Linux would pick it up and run the maintence.

But how should this be done/formatted on a Plesk server then?

Thanks in advance.
 
Hi @scsa20 and thanks for the reply.

Yeah, I'm want to run a maintenance script for Laravel so i can go ahead and update this web app to the latest version, plus it would need to run again after the update.
I'm still uncertain what I need to replace the www-user with though.

First for maintence:
sudo php artisan optimize

second one is for after update:
sudo -u www-data php artisan migrate

From the app documentation to give an example.
1673305868784.png


Thanks for the link too!

Kind regards.
 
Like I said, you could create a schedule task using the link I've provided. If you want to run it yourself then you use the system user of the domain in question or you could use the root (not recommended) account. Plesk does not use www-data. You can find the name of the system account used by looking at the web hosting access of the domain, for system user.
 
Thanks I have figured it out.
Plesk does not use www-data
Well I was more just looking for what it uses instead. The setup Plesk uses is obviously quite new and a bit weird (and a bit confusing) to me when yo come from running traditional servers. So the learning curve is a lot to take in. ;-)

Anyway, thanks a bunch for your kind help @scsa20 !
Kind regards
 
For me the challenge to explain it is that www-data is used for both, owner and group, on many standard Linux configurations. I do not know Laravel well enough to being able to say, whether your command needs the group owner or the website owner. I assume as it has "-u" in it, it is very likely the website owner. In that case, replace www-data with the system user of your webspace account. You can find the name of that user in Websites & Domains > Hosting & DNS > Web Hosting Access > System user > Username.

According to this detailed article on using Laravel with Plesk, there is no need to run the command on a system level at all. And that might be a better choice, because many such things require the right PHP version, the right user etc.

Instead: "And yes, you can run the ‘artisan‘ utility straight from the Plesk interface. Switch to the ‘Artisan‘ tab, and then choose the ‘migrate‘ command from the list of preloaded commands."
 
@LionKing Plesk provides the Laravel Toolkit extension from which you can manage any Laravel project/app directly from within Plesk (GUI). Including an option to enable Scheduled Tasks (which creates a cron job that runs artisan schedule:run) and the ability to run any other artisan command.

If you still like to run artisan commands via SSH you can use:
Bash:
cd /var/www/vhosts/example.com/httpdocs/
sudo -u sys_user_of_domain /opt/plesk/php/8.1/bin/php artisan migrate

Since you stated you're new to Plesk I like point out that instead of just calling PHP in the command you'd use the path the specific PHP version used for your domain. In the example command above it's version 8.1, but if you're running 8.0 you'd use /opt/plesk/php/8.0/bin/php. When you're calling just PHP the default PHP version that shipped with OS would be used (which is likely to be an older version).

Hope this helps.
 
Last edited:
Btw...
For the web app Invoice Ninja which we use in our company I need to install some php extentions for SnapPDF to work.
Now normally on my old Linux servers I would just run that suggested command out of the box e.g.

sudo apt install libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libpangocairo-1.0-0 libgtk-3-0

But on Plesk? :rolleyes:
Should I just still install these dependencies globally in Linux itself or is there another route when dealing with a Plesk server?
Or maybe you just run that command on the web hotel (subscription user), so these PHP libraries only run there?
So what is the correct way to do this?
 
Those aren't php extensions or libraries, the php scripts are calling chrome to do the dirty work, which needs those extra system libraries. I'd say install them globally.
 
Back
Top