101

Using cpanel on my hosting account, I created a subdomain - e.g. www.clothing.mysite.com

A cgi-bin folder was automatically created in the directory for clothing.mysite.com. Do I need it? I'm only using the subdomain to install wordpress on it. I don't really understand what the cgi-bin folder is for and I'm happy to leave it if it doesn't harm anything. Any thoughts?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Margo
  • 1,013
  • 2
  • 7
  • 4
  • 3
    delete it along with all the _anoying frontpage server extention files –  Feb 05 '11 at 07:33

4 Answers4

103

cgi-bin historically was the only place where executable or script code (binaries, shell scripts, etc.) could be stored. It is mostly a historic relic since most hosts allow execution of scripts from anywhere.

David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
93

You can safely delete it. "cgi-bin" is hardly ever used these days.

janmoesen
  • 7,910
  • 1
  • 23
  • 19
  • 13
    It's good that you gave the brief answer first, but it's important to give some explanation. Without that, people can only trust that you're right. – Márton Tamás Jun 04 '18 at 10:38
17

You can safely delete "cgi-bin" folder, it's hardly ever used nowadays

Also beware that when your server got some malware scripts scans different folders and then hides on folders like cgi-bin because they rarely are checked now.

I even wrote a script before that "monitors" different folders in my server and alerts me if it found different scripts in there on my personal and clients servers too.

fedmich
  • 5,343
  • 3
  • 37
  • 52
2

I haven't seen it mentioned but it might also be worth noting that since cgi-bin is traditionally used to execute scripts, some hosting providers might require you to edit your .htaccess file if you wish to execute scripts outside cgi-bin (same is true if you deleted your cgi-bin).