Large-scale multi-AP WLANs with a high density of users and access points (APs) have emerged widely in various hotspots, where intra-cell interference is detrimental to the performance of WLANs. In order to mitigate the interference, a new system called cognitive WLAN over Fiber is presented in recent years. In this paper, based on Hidden Markov Modeling (HMM) detector's spectrum detection for Primary Users (PUs), we model the RAU allocation problem for CWLANoF not only to maximize the overall system capacity, but also to guarantee PUs' transmission. In order to cope with this problem, RAU allocation based on Antenna Allocation for Maximizing System Capacity (RAMSC) algorithm is proposed with low computation complexity, using local search. Finally, extensive simulation results illustrate that the proposed RAMSC algorithm significantly enhances the overall system capacity and guarantees the transmission of PUs in density CWLANoF systems.