0

I installed apache 2.4.7 server as I switched from Windows, in which I used WAMP, so now I am using apache2 in Ubuntu I want to make old www directory of WAMP as the new root directory of apache2 in Ubuntu.

So I made the following changes. (My PC username is siraj and name of the drive is MINE)

In apache2.conf file

<Directory /media/siraj/MINE/Business_Work/wamp/www/html>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

In 000-default.conf file.

DocumentRoot /media/siraj/MINE/Business_Work/wamp/www/html

<Directory />
     Options FollowSymLinks
     AllowOverride All
     Require all granted
 </Directory>

 <Directory /media/siraj/MINE/Business_Work/wamp/www/html/>
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All
     Require all granted
</Directory>

and sudo chown -R www-data /srv/www/html

Now the thing is, in first case localhost running well, but in second case (when changing root directory to another drive) it shows following error:

Forbidden

You don't have permission to access / on this server.

Apache/2.4.7 (Ubuntu) Server at localhost Port 80

Here's My apache error log.

(13)Permission denied: [client 127.0.0.1:51063] AH00529: /media/siraj/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/media/siraj/' is executable, referer: http://localhost/

Here's the output of command: namei -lx /media/siraj/MINE/Business_Work/wamp/www/html/

f: /media/siraj/MINE/Business_Work/wamp/www/html/
Drwxr-xr-x root  root  /
drwxr-xr-x root  root  media
drwxr-x--- root  root  siraj
Drwx------ siraj siraj MINE
drwx------ siraj siraj Business_Work
drwx------ siraj siraj wamp
drwx------ siraj siraj www
drwx------ siraj siraj html

I've seen almost all the similar questions asked here. But didn't find what I am missing here.

1 Answers1

0

After searching whole day finally here's the complete solution.

As @muru told to go here I sum up things I found after searching in many places.

As we can't change the mod of drive using chmod as it is defined by partition's mount option. So we mount the target drive (MINE in my case) in current drive (ext4 in my case.).

First,find the UUI and partition name table of your drive using following command

$ sudo blkid

Now unmount the target drive (sda6 in my case get from the above command) using following command.

$ sudo umount /dev/sda6

Now type the following command to mount the target drive in current drive.

sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000 /dev/sda6 /srv

Now make the changes in 000-default.conf and apache2.conf file like done in question.

That's It. Celebrate.