Skip to content

Instantly share code, notes, and snippets.

Last active Jun 28, 2017
What would you like to do?
Ubuntu 14.04 with Plesk 12: move /var/www/vhosts to another location
Use "sudo command" or as root user:
In this example /var/www/vhosts is moved to /data/www/vhosts on another partition. Change all steps as your needed for your location.
1) Stop services
~# /etc/init.d/psa stopall
~# /etc/rc.d/init.d/psa stopall
~# /etc/init.d/apache2 stop
~# /etc/init.d/mysql stop
~# service mysql stop
2) Move /var/www/vhosts -> /data/www
~# mkdir /data/www
~# mv /var/www/vhosts /data/www/vhosts
~# ln -s /data/www/vhosts /var/www/vhosts
3) Edit "/etc/psa/psa.conf"
Change HTTPD_VHOSTS_D in psa.conf to
HTTPD_VHOSTS_D /data/www/vhosts
3) Enhance Apache config "/etc/apache2/conf-enabled/aa001_data_www.conf"
<Directory /data/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
4) Edit Plesk Apache config "/etc/apache2/plesk.conf.d/server.conf"
Search for "/var/www/vhosts" and replace by "/data/www/vhosts"
5) Start services
~# /etc/init.d/mysql start
~# service mysql start
6) Reconfigure Plesk
~# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
7) Check "/etc/apache2/plesk.conf.d/server.conf"
Is still everything in there as expected, e.g. "/data/www/vhosts"? If Yes, then
8) Start services
~# /etc/init.d/apache2 start
~# /etc/init.d/psa startall
~# /etc/rc.d/init.d/psa startall
That's it.
Copy link

RobertoBL commented Aug 19, 2016

In step 7 server.conf change again to /var/www/vhosts, can you help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment