This is an example under the definition of how in the Oxford Advanced Learner's Dictionary.
He did not know how he ought to behave.
The dictionary lists how as an adverb. I understand this is because it modifies the verb behave, but I think it acts as a noun here.
Suppose we change how to the way.
He did not know the way he ought to behave.
The meaning is still the same, but it looks like the way acts as a noun phrase here.
So, are both how and the way adverbs in this situation or are they nouns? If they are neither, what are they?