DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

No input file specified error is displayed on Directadmin server

| 18:57:27 24.03.2019

I've got a "No input file specified" error in a browser when requesting a non-existing file from my site. I want my 404 error to be shown instead of it. How to fix?

Check the use-case first of all, it is valid only for the following software:

  • Apache
  • PHP-FPM
  • Directadmin server

So if you have the server with the installed software as mentioned, here you can find a possible solution.


Are you not patched yet?

DirectAdmin developers added the patch into their repository, and the patched templates will be available with a new release of the control panel. So it is available with DA 1.56.1 or newer.

If the version is already released just make sure and upgrade the panel. If you are already updated, but still see the error, check the guide further.


Still need to manually check it?

You will need to connect to your server over SSH or a console as root, and copy templates to a custom folder.

Make sure your templates do not contain the fix already, run for this:

cd /usr/local/directadmin/data/templates/
grep REQUEST_FILENAME virtual_host2* -c

The templates are not patched yet if you see:

virtual_host2.conf:0
virtual_host2_secure.conf:0
virtual_host2_secure_sub.conf:0
virtual_host2_sub.conf:0

and this one:

grep REQUEST_FILENAME custom/virtual_host2* -c

One of the following outputs is expected:

custom/virtual_host2.conf:0
custom/virtual_host2_secure.conf:0
custom/virtual_host2_secure_sub.conf:0
custom/virtual_host2_sub.conf:0

or

grep: custom/virtual_host2*: No such file or directory

If outputs in your case differ from what is shown here as expected then you might need to stop following the guide.


Customizing Apache templates

Do not overwrite existing files, if you are asked for a confirmation. 

Run:

cd /usr/local/directadmin/data/templates
cp virtual_host2*.conf custom
cd custom

Once you've copied the 4 VirtualHost files, open them one by one in a text editor for editing.

Find the lines:

<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
    #ProxyErrorOverride on
    AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .inc .php .phtml .php|PHP1_RELEASE|
</FilesMatch>

The line with ProxyErrorOverride might be missing.

and change them to

<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
    <If "-f %{REQUEST_FILENAME}">
        AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .inc .php .phtml .php|PHP1_RELEASE|
    </If>
</FilesMatch>

save and exit.

As soon as you complete the all 4 files run the following commands:

cd /usr/local/directadmin/custombuild
./build rewrite_confs

It will update configs for all existing virtual hosts in Apache.

That's it.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition