How to setup a volume in the web directory with CentOS and Plesk

I am begging to run out of storage on my droplet. There is one folder in particular that stores images that is taking up the space. Rather than changing my droplet specs, it seems as though a volume would solve the problem. Unfortunately, I am unable to get a volume to work with this setup (CentOS/Plesk). The volume is mounted here /mnt/volume_nyc1_01 and I attempted to make a symlink from var/www/vhosts/ After ensuring the owner/and group were correct I still ran into 403 permission errors. I then attempted to mount the volume directly to var/www/vhosts/ but still ran into permission issues. After reading some tutorials here, I discovered my problem may be with SELinux permissions. It is enabled on my server. I attempted to use httpd_sys_rw_content_t with semanage & restorecon. This allowed me to view the files via a web browser but my scripts are still unable to write to these directories. Is there a simpler more straightforward way to do this without turning off SELinux?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
April 4, 2022

Hello there,

Have you tried to set SELinux to permissive mode and then give it another go? When SELinux is running in permissive mode, SELinux policy is not enforced. The system remains operational and SELinux does not deny any operations but only logs AVC messages, which can be then used for troubleshooting, debugging, and SELinux policy improvements.

From previous experience and looking at Plesk’s docs they also recommend setting SElinux in permissive mode, an example is when trying to use another drive to host websites (change vhost directory)

Hope that this helps!