In the sentence "Why is this here?", is "why" an adverb? What part of speech is "why?" I think it modifies the verb "is", so I think it is an adverb.
Yes, it's an adverb. And in your case, it does modify the verb is. When used as an adverb, why has the meaning of for what reason or purpose. Semantically, it fits your example perfectly.
Point to consider: Parts of Speech in English are fluid and depend upon context and function in real language situations. "Why" is most often used as an Object of a verb, as in "She wondered WHY," (what she wondered), not as the verb's adverb, as in "Why did she wonder?"
But, just to mess things up a little more, consider this: "why" can inarguably replace a noun, a noun phrase, clause or more, so it can also therefore be used as a pronoun, ("She knew [what did she know?] -she knew why."]
What's worse for those old fossilized grammar school pedants is that "Why" can even be considered a relative pronoun, (perish the thought!). Quirk & Greenbaum: A University Grammar of English chapter 13, section 7 notes that 3 of those nasty "wh" pronouns can function as relative pros. For example, in the sentence, "The man walked to the place 'where' the shooting occurred," Where acts as a relative answering 'which' "place" – WHERE the shooting occurred"!
' why are you here ' - it reflects an exclamatory sense. Hence, 'why' should be an interjection.