0

My project path is /media/zarpio/40D41555D4154E92/projects/www/muhammadkhalil/public_html_ci this is ntfs separate partition (drive).

I have created virtualhost file given below.

<VirtualHost *:80>

    ServerName ci.muhammadkhalil.com
    ServerAlias www.ci.muhammadkhalil.com
    ServerAdmin admin@muhammadkhalil.com

    DocumentRoot /media/zarpio/40D41555D4154E92/projects/www/muhammadkhalil/public_html_ci/public_html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /media/zarpio/40D41555D4154E92/projects/www/muhammadkhalil/public_html_ci/public_html/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>

</VirtualHost>

Please advise me what is wrong with my virtualhost file, if I change DocumentRoot /var/www/muhammadkhalil.com/public_html it works fine, but I need to put my every projects into the separate hard drive.

muru
  • 197,895
  • 55
  • 485
  • 740
zarpio
  • 343
  • @muru you have edited my question fine, but where is the answer? Please answer the question. – zarpio Feb 12 '15 at 19:14
  • I have given a potential answer, however there are variants. Information from your /var/log/apcahe2/error.log file will help, as will what version of Ubuntu you are using. – Doug Smythies Feb 12 '15 at 19:19
  • I am using 14.04LTE. I have tried following lines you mentioned in the answer but they are not working. – zarpio Feb 12 '15 at 19:22
  • There should be related entries in /var/log/apache2/error.log. Please add them to your question. Also please add the listing from ls -l -d for the directory and every parent directory all the way way up to and including /media. – Doug Smythies Feb 12 '15 at 19:29
  • [Fri Feb 13 00:34:32.936111 2015] [core:error] [pid 7263] (13)Permission denied: [client 127.0.0.1:46264] AH00035: access to / denied (filesystem path '/media/zarpio/40D41555D4154E92') because search permissions are missing on a component of the path – zarpio Feb 12 '15 at 19:34
  • @zarpio Update your post with the output of namei -m /media/zarpio/40D41555D4154E92/projects/www/muhammadkhalil/public_html_ci/public_html – muru Feb 12 '15 at 19:57
  • f: /media/zarpio/40D41555D4154E92/projects/www/muhammadkhalil/public_html_ci drwxr-xr-x / drwxr-xr-x media drwxr-x--- zarpio drwx------ 40D41555D4154E92 drwx------ projects drwx------ www drwx------ muhammadkhalil drwx------ public_html_ci – zarpio Feb 12 '15 at 20:16
  • It is hard to understand, and should have been edited into your original question and formatted properly. Anyway... Changes all the permissions to at least 755. – Doug Smythies Feb 12 '15 at 21:12

1 Answers1

0

You need to have all the parent directory permissions set correctly (at least 755).

An error entry in /var/log/apache2/error.log similar to this:

[Fri Jan 30 16:31:37.879239 2015] [authz_core:error] [pid 2900] [client 192.168.111.101:56597] AH01630: client denied by server configuration: /media/newhd/test_web/

Should indicate that your only problem is that you need to modify the default security model of the Apache2 HTTPD server to allow access to the files. The file /etc/apache2/apache2.conf needs to be edited (as sudo) and these lines added:

<Directory /media/zarpio/40D41555D4154E92/projects/www/muhammadkhalil/public_html_ci/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Additionally, an error entry in /var/log/apache2/error.log similar to this:

Forbidden, you have permission to access files on this server

indicates an incompatible filesystem (for example ntfs will not work) or other incompatibility. Examine the permissions hierarchy for any extended permissions (indicated by a plus sign). Example (without extended permissions) permissions hierarchy:

drwsrwsrwt 8 root root 4096 Nov 28 19:55 /media
drwxr-xr-x 5 root root 4096 Jan 30 16:24 /media/newhd
drwxr-xr-x 2 root root 4096 Jan 30 16:26 /media/newhd/test_web
-rw-r--r-- 1 root root 1422 Jan 30 16:26 /media/newhd/test_web/index.html
Doug Smythies
  • 15,448
  • 5
  • 44
  • 61