[Tex/LaTex] Header margin bigger

header-footermargins

I'm trying to make the header "margin" bigger. It is to close to the edge.
I've been trying to make \setlength{\headheight}{10pt} larger but then the page number moves to much down?

Any thoughts?

\documentclass[a4paper,12pt]{report}

\usepackage[margin=2cm]{geometry}
\usepackage{fancyhdr}
    \pagestyle{fancy}

\lhead{\nouppercase{\leftmark}}      % Set chapter in left header.
\rhead{\nouppercase{My University}}  % Set my university name in right header.
\setlength{\headheight}{10pt}        % ??????????????????

\begin{document}
    \chapter{First Chapter}                               %
    First chapter's content.
    \clearpage
    \section{Hello}
    The header is to close to the edge..
\end{document}

Best Answer

You get a warning;

Package Fancyhdr Warning: \headheight is too small (10.0pt): 
 Make it at least 14.49998pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

fancyhdr tells you that header should be 14.4999pt high atleast. So make it 16pt to be safe. And do it with geometry package.

\usepackage[margin=2cm,top=2.5cm,headheight=16pt,headsep=0.1in,heightrounded]{geometry}

headsep=0.1in,heightrounded are other settings just for achieving perfection. In addition, you can increase the top margin as above.

\documentclass[a4paper,12pt]{report}

\usepackage[margin=2cm,top=2.5cm,headheight=16pt,headsep=0.1in,heightrounded]{geometry}
\usepackage{fancyhdr}
    \pagestyle{fancy}

\lhead{\nouppercase{\leftmark}}      % Set chapter in left header.
\rhead{\nouppercase{My University}}  % Set my university name in right header.
%\setlength{\headheight}{16pt}        %<---- Not this way

\begin{document}
    \chapter{First Chapter}                               %
    First chapter's content.
    \clearpage
    some text
    \section{Hello}
    The header is to close to the edge..
\end{document}

enter image description here