Using mount –bind To Move The Website And Email Directory Of a ISPConfig 3 Server To a New Directory

Use mount –bind To Move The Website And Email Directory Of a ISPConfig 3 Server To a New Directory

In the following guide, I will explain the procedure on how to move the email and website directory of a ISPConfig 3 installation to a new partition. This might become handy when your current partition runs out of space. I will use a bind mount for this, a symlink will not work here as ISPConfig checks path for symlink attacks, so if the website or email path contains a symlink, ISPConfig will reject to write to that directory. In this example, I will move the www and email directory to the /home partition. You dont have to move both partitions together, so moving just the email or web partition will work as well.if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-box-3-0’)};

Stop the email and web serverif(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-3-0’)};

service postfix stop
service dovecot stop

When you use apache, use:

service apache2 stop

For nginx server, use:

service nginx stop

Move the email directory to the /home partition

mv /var/vmail /home/

and create a new mount point with correct permissions

mkdir /var/vmail
chown vmail:vmail /var/vmail

Move the www directory to the /home partition

chattr -i /var/www/clients/client*/web*
umount /var/www/clients/client*/web*/log
mv /var/www /home/

and create a new mountpont

mkdir /var/www

Now edit the /etc/fstab file to add the 2 bind mounts

vi /etc/fstab

add the following 2 lines right after the lines for your harddisk partitionsif(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-4-0’)};

/home/vmail /var/vmail none bind,nobootwait,_netdev 0 0
/home/www /var/www none bind,nobootwait,_netdev 0 0

apply the new mount configuration

mount -a

and start the services

service postfix start
service dovecot start

for apache servers:

service apache2 start

for nginx servers use:

service nginx start

 

  • http://www.ispconfig.org
About the Author

Leave a Reply