Alves goal gives Portugal advantage
Liedson missed Portugal's best chance to double the lead in the second half, but Edin Dzeko and Zlatan Muslimovic almost stunned the Portuguese by hitting the bar and the post in the 89th minute.
"I think with the image of that moment when the ball hit the post and the bar we can recognise we were lucky," Portugal coach Carlos Queiroz told reporters.
"But it was the same gods that protected Bosnia when Liedson missed the goal, because he doesn't usually miss those chances."
Portugal dominated the first half hour, with Nani exploiting space on the right wing to give Emir Spahic a torrid time. Liedson headed just wide in the eighth minute and Nani failed to score at the end of a flowing Portuguese move 10 minutes later.
The hosts took a deserved lead after 31 minutes when Nani crossed for Alves to head in unchallenged at the far post.
The goal spurred the Bosnians and Vedad Ibisivec sent a close-range effort just over. Sejad Salihovic's shot forced Eduardo to a block on 38 minutes, but Portugal's biggest scare came when Senijad Ibricic sent a header crashing against the bar in the 43rd minute.
Queiroz acknowledged his side's inconsistent performance.
"It's natural that happened, but we played ... intelligently. In some moments we played well and dominated, and when he had to suffer we knew what to do," he said.
Portugal surged forward in the second half and Liedson came close to giving them the precious second goal in the 55th minute. The striker received a fine pass from Deco and coolly beat his marker but sent his effort just over the Bosnian goal.
Bosnia did not pose much of a threat for most of the second half but almost stunned the Portuguese in a sensational double-chance in the 89th minute.
Dzeko's header hit Eduardo's bar, with the ball falling to Muslimovic only for the midfielder's shot to hit the post and deny the Bosnians a precious away goal.
The second leg is in Zenica on Wednesday when Portugal will again be without Cristiano Ronaldo who has an ankle injury.
"It's natural that any team in the world will miss a player like Ronaldo, but Nani, who played in his place, had a good match," Portugal playmaker Deco said while adding he felt the 1-0 victory had given them the advantage.
"One goal for us means Bosnia have to score three. I think we will have more space in the away game.
"If we play an intelligent game we can control it and surprise them on the counter."