Boys are physical and they learn to really dig a power struggle.
It is not fun to be hit, but I don't believe at 18 months he will understand a discipline measure such as a time-out as it is related to the issue at hand. I do think he will understand the unpleasantness of a time-out, but it won't be associated with the actual act of hurting another person. They are so in the moment at that age.
I have an 18 mth old too. I have been hit a couple of times, but I didn't see it coming.

If he is hitting to wake you up or get your attention, just grab his hand as it is coming and tell him "soft" and show him how to pat you or softly touch you. This works with pets too. You have to physically show him how you want him to touch you. He has no idea of this strength. Keep at it and he will learn.
If he is hitting out of anger, I do the "soft" method again. If he lays into me again, I move away and say, "I do not want to be hit." If he crys and runs after me, I will pick him up and hug him and gently restrain him while repeating myself about not being hit. I find that it is part of a tantrum often times and a hug at this age works better than something harsh. They just can't figure out how to express themselves.
For the biting, you need to be right there to prevent it from happening before it does NOT arrive after each time to try to deal with it. I would catch him and say: Not for biting. If he tries again, repeat yourself. If he tries again, remove him from the situation.
Redirection is your best friend with an 18 mth old. While I agree with Norasmom, I don't think our 18 mth old kids will get the whole picture. I think that is an excellent method to try with an older child.
A younger toddler is pretty much a total cause and effect learner. Here is what they see:
Hit someone
Mommy yells
Hit again
Mommy yells
Hit again
Mommy yells
While they are unhappy with your reaction, they are just guaging the reactions not taking any life lessons from it for the most part. Softly restraining, redirecting and moving on, makes it less of a power struggle and more of a gentle correction while we move on with real life.
HTH!