Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My main hard drive is being used both as the installation and for my website is there a way Ubuntu can use the second hard drive for my website ? do I have to copy my website to the new drive ? if yes is it going to be difficult ?

 ls -l /etc/apache2/sites-enabled/
total 0
lrwxrwxrwx 1 root root 26 Jan 26 2013 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 28 Jan 27 2013 wordpress -> ../sites-available/wordpress
share|improve this question
Yes i'm using Apache2. – user239939 Jan 26 '14 at 14:14
Yeah, you can copy it, and change the root directory DocumentRoot in Apache2 site file sudo gedit /etc/apache2/sites-enabled/000-default.conf. replace 000-default.conf with your own site file. – Sneetsher Jan 26 '14 at 14:20
I'm sorry but which site file ? I'm using Joomla. – user239939 Jan 26 '14 at 16:29
I tryed to open 000-default.conf but there is no file it creates a new one. – user239939 Jan 26 '14 at 17:50
Could you add the contents of /etc/apache2/sites-enabled/000-default and /etc/apache2/sites-enabled/wordpress to your question. – Sneetsher Jan 26 '14 at 20:44
up vote 0 down vote accepted

I assume you are using the default apache root folder /var/www

If you don't understand what it does, Leave it!

  • Use Disks utility: Select the new hard drive → Create New Partition (as Ext4)
  • Still with Disks utility: Edit Mount Options, something like this

Mount options

  • Mount the new partition
  • Stop Apache

    sudo service apache2 stop
  • Copy files with -a option to preserve all

    sudo cp -a /var/www /media/files/
  • Edit DocumentRoot in 000-default and wordpress to follow the new path.

    sudo gedit /etc/apache2/sites-enabled/000-default
    sudo gedit /etc/apache2/sites-enabled/wordpress

Example: DocumentRoot /var/wwwDocumentRoot /media/files/www

  • Start Apache again:

    sudo service apache2 start
  • Test it for sometime, if OK Delete old files.

    sudo rm -r /var/www/*
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.