Apparatus and method for producing a component as well as aircraft structural component