• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Apache can't serve PHP file from DigitalOcean bulk storage volume

KDawson

New Pleskian
I have a CentOS 7.3 instance at DigitalOcean (DO) running Plesk Onyx 17.5.3 and Apache 2.4.6. The use of nginx is disabled so Apache is acting alone. (Tools & Settings > Services Management > Reverse Proxy Server (nginx) stopped.) Externally, Wappalyzer reports that the server in use is Apache.

If .php files are located on a DO bulk storage volume, the server cannot find them and returns a status of 404 -- but also emits the text "No input file specified" which seems to come from nginx, though that service is not proxying.

These tests are in directories test-local and test-remote under the webroot. All test files, directories, and symlinks are owned (in the sense of Linux ownership and permissions) by the owner of the webroot.

You can try the tests at the following URLs:

the test
Hello, world!
phpinfo()

the test
Hello, world!
http://exfacto.com/test-remote/test.php
_________________

Test files:

Two sets of one each .html, .pl, and .php -- one set in a local directory and one set symlinked to a directory on a DO volume:

# [do: httpdocs] 797 > pwd
/var/www/vhosts/exfacto.com/httpdocs

# [do: httpdocs] 798 > ls -lFd test*
drwxr-xr-x 2 gs-exfa psacln 4096 Aug 7 11:28 test-local/
lrwxrwxrwx 1 gs-exfa psacln 37 Aug 7 11:26 test-remote -> /mnt/extrnal/test-remote/

# [do: httpdocs] 799 > ls -lF test*/
test-local/:
total 12
-rw-r--r-- 1 gs-exfa psacln 222 Aug 7 11:27 test.html
-rw-r--r-- 1 gs-exfa psacln 18 Aug 7 11:27 test.php
-rwxr-xr-x 1 gs-exfa psacln 170 Aug 7 11:27 test.pl*

test-remote/:
total 12
-rw-r--r-- 1 gs-exfa psacln 222 Aug 5 11:38 test.html
-rw-r--r-- 1 gs-exfa psacln 18 Aug 6 19:57 test.php
-rwxr-xr-x 1 gs-exfa psacln 170 Aug 7 11:25 test.pl*

# [do: httpdocs] 800 >
_________________

Results:

the test works
Hello, world! works
phpinfo() works

the test works
Hello, world! works
http://exfacto.com/test-remote/test.php "No input file specified." -- status 404

P.S. -- I didn't know that this forum software would replace the URLs I included with linked text derived from visiting them. You can see that the latter, test-remote, case cannot be resolved in that way.
 
Last edited:
I have tried four variants of ways to point to the directory on the DO volume: two using Apache server aliases and two using symlinks. For each, one variant pointed directly into the bulk storage volume and the other pointed into the same file system to a symlink to the volume.

In the Apache server alias variants, both the doc-root and the symlinked directory have "Options +Includes +ExecCGI" specified.

In all of these scenarios, all files, directories, and symlinks are owned (in the Linux sense of ownership / permissions) by the owner of the docroot.

I. symlink, direct
- {docroot}/test-remote => /mnt/external/test-remote/

-or-

II. symlink, indirect via same file system
- /var/www/test-remote => /mnt/external/test-remote/
- {docroot}/test-remote => /var/www/test-remote/

Result:
test.html: works
test.pl: works
test.php: "No input file specified." [from nginx instead of 404]

III. server alias, direct
- Alias "/test-remote" "/mnt/external/test-remote"

Result:
test.* all give 403 forbidden

IV. server alias, indirect via same file system
- /var/www/test-remote => /mnt/external/test-remote/
- Alias "/test-remote" "/var/www/test-remote"

Result:
test.html: works
test.pl: downloads instead of executing
test.php: downloads instead of executing
_________________

Variant I. above is now in place. You can try the tests at the following URLs:

the test
Hello, world!
phpinfo()

the test
Hello, world!
http://exfacto.com/test-remote/test.php
 
Back
Top