So, this. This has been a pain in the ass for EVER. Every time I install VestaCP, I have to fix this before doing anything else with my code.
This issue wasn’t there when I started using VestaCP. Then came an update. Yeah, you get my point. ????
I know it’s good for security. But still it’s a pain. So here’s how to get stuff working.
Please replace the following things with yours in my commands.
- User: admin
- Domain: example.com
- Text-Editor: nano
- Folder I want include files from: /home/%user%/web/%domain%/project
- Change directory to your VestaCP user’s web config folder
1
cd/home/admin/conf/web - List files
1
ls-laYou should see some files like
12example.com.httpd.confexample.com.nginx.conf - Open up ‘example.com.httpd.conf‘ in a text editor
Content will be similar to the follwing123456789101112131415161718192021222324252627282930313233343536<VirtualHost ***.***.***.***:****>ServerName example.comServerAlias www.example.comServerAdmin info@example.comDocumentRoot/home/admin/web/example.com/public_htmlScriptAlias/cgi-bin//home/admin/web/example.com/cgi-bin/Alias/vstats//home/admin/web/example.com/stats/Alias/error//home/admin/web/example.com/document_errors/#SuexecUserGroup admin adminCustomLog/var/log/httpd/domains/example.com.bytes bytesCustomLog/var/log/httpd/domains/example.com.log combinedErrorLog/var/log/httpd/domains/example.com.error.log<Directory/home/admin/web/example.com/public_html>AllowOverride AllOptions +Includes -Indexes +ExecCGIphp_admin_value open_basedir/home/admin/web/example.com/public_html:/home/admin/tmpphp_admin_value upload_tmp_dir/home/admin/tmpphp_admin_value session.save_path/home/admin/tmp</Directory><Directory/home/admin/web/example.com/stats>AllowOverride All</Directory><IfModule mod_ruid2.c>RMode configRUidGid admin adminRGroups apache</IfModule><IfModule itk.c>AssignUserID admin admin</IfModule>IncludeOptional/home/admin/conf/web/httpd.example.com.conf*</VirtualHost> - Append the folder you want to ‘php_admin_value open_basedir‘ like the following example
1
php_admin_value open_basedir/home/admin/web/example.com/public_html:/home/admin/tmp:/home/admin/web/example.com/project - Save and quit the file
- Restart Apache Server
You could use the VestaCP interface to restart the Apache Server OR use the following command1service httpd restart
Cheers!