Change Apache document root folder to secondary hard drive at Ubuntu 16.04 LTS

Follow the following steps to change default document root directory.

  1. Create a directory at secondary HDD as /data/www/html
  2. sudo vi /etc/apache2/apache2.conf
    At line number 164 replace the directory name from <Directory /var/www/> to
    <Directory /data/www/>
  3. sudo vi /etc/apache2/sites-available/000-default.conf
    at line number 12 replace DocumentRoot /var/www/html to DocumentRoot /data/www/html
  4. restart apache service
    systemctl restart apache2  or /etc/init.d/apache2 restart

Apache document root directory changed. Now try to visit your site.

Advertisements

Installing Apache, MySQL Server 5, phpmyadmin on Ubuntu

To Install Apache, MySQL Server 5, phpmyadmin on Ubuntu you need to run the following command on Terminal.

First Open Terminal (Press Alt+F2 for open run dialogue box, type gnome-terminal and press Enter)

sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5-mysql
sudo apt-get install phpmyadmin

sudo apt-get install mysql-admin

To create a new database, use the mysqladmin command:

mysqladmin create <databasename>