文廟(miao)始建于1477年,位(wei)(wei)于桂(gui)林(lin)市恭城縣(xian)西(xi)山南麓,是廣西(xi)保存較(jiao)為(wei)完整的(de)孔(kong)(kong)廟(miao),也是自治區重點文物(wu)保護單位(wei)(wei)。文廟(miao)是為(wei)祭祀我國古(gu)代(dai)政治家、思想家和教育家孔(kong)(kong)子(zi)而建的(de)圣廟(miao)。
文廟(miao)坐北朝南(nan),南(nan)偏東6度,俯視茶江,背靠印山,依山而(er)建(jian),逐(zhu)層布置(zhi),顯得莊嚴(yan)肅穆。全(quan)廟(miao)占地3600平方米(mi),建(jian)筑面(mian)積1300平方米(mi)。由(you)兩邊耳門(men)(men)(men)出入(ru)(ru),東向(xiang)門(men)(men)(men)叫(jiao)禮門(men)(men)(men),西向(xiang)門(men)(men)(men)叫(jiao)義路(lu),門(men)(men)(men)外立(li)禁碑一塊,上刻“文武(wu)官員至此下馬(ma)”,以示(shi)孔(kong)廟(miao)的莊嚴(yan)。正面(mian)是照壁,沒有(you)開大(da)門(men)(men)(men),據說等(deng)有(you)人中了狀元(yuan),才在照壁中間(jian)開大(da)門(men)(men)(men),稱(cheng)狀元(yuan)門(men)(men)(men),想(xiang)從大(da)門(men)(men)(men)步入(ru)(ru)欞(ling)星門(men)(men)(men),唯(wei)狀元(yuan)莫屬。
新中(zhong)國(guo)成(cheng)(cheng)(cheng)(cheng)立后(hou),為(wei)(wei)方(fang)便(bian)群眾游覽,把狀(zhuang)元(yuan)門(men)(men)打(da)開(kai)了。欞星(xing)門(men)(men)相(xiang)傳(chuan)是(shi)(shi)(shi)漢高祖命(ming)祀欞星(xing)而移用于孔(kong)(kong)廟(miao),以尊天(tian)者尊孔(kong)(kong)為(wei)(wei)本意。該門(men)(men)全部青(qing)石砌筑,上(shang)(shang)面(mian)刻(ke)有(you)(you)(you)“欞星(xing)門(men)(men)”三(san)個大(da)字,還有(you)(you)(you)雙(shuang)龍戲珠、雙(shuang)鳳朝陽(yang)等浮雕(diao)。欞星(xing)門(men)(men)的(de)(de)六(liu)根大(da)石柱頂端有(you)(you)(you)六(liu)只(zhi)小石獅互相(xiang)窺(kui)視著。過了欞星(xing)門(men)(men)便(bian)是(shi)(shi)(shi)泮池(chi),又叫(jiao)月池(chi),料石砌就(jiu),周圍以青(qing)石為(wei)(wei)欄(lan),有(you)(you)(you)石拱橋(qiao)(qiao)跨過池(chi)面(mian),稱狀(zhuang)元(yuan)橋(qiao)(qiao),意為(wei)(wei)狀(zhuang)元(yuan)才能通過,橋(qiao)(qiao)面(mian)有(you)(you)(you)一塊刻(ke)有(you)(you)(you)云紋浮雕(diao)的(de)(de)青(qing)石,為(wei)(wei)“青(qing)云直上(shang)(shang)”之意。由(you)欞星(xing)門(men)(men)步(bu)上(shang)(shang)兩(liang)層平臺,便(bian)是(shi)(shi)(shi)大(da)成(cheng)(cheng)(cheng)(cheng)門(men)(men)。大(da)成(cheng)(cheng)(cheng)(cheng)門(men)(men)由(you)十(shi)(shi)一扇(shan)木(mu)門(men)(men)組成(cheng)(cheng)(cheng)(cheng),木(mu)質結構,門(men)(men)扇(shan)上(shang)(shang)樓空的(de)(de)花(hua)鳥蟲魚雕(diao)刻(ke),栩栩如生。大(da)成(cheng)(cheng)(cheng)(cheng)門(men)(men)東面(mian)是(shi)(shi)(shi)名宦祠,西面(mian)是(shi)(shi)(shi)鄉賢(xian)祠,是(shi)(shi)(shi)供奉(feng)歷代先(xian)賢(xian)、先(xian)儒的(de)(de)地方(fang),計有(you)(you)(you)一百四(si)(si)十(shi)(shi)三(san)個靈(ling)位。大(da)成(cheng)(cheng)(cheng)(cheng)門(men)(men)后(hou)面(mian)是(shi)(shi)(shi)天(tian)井(jing),前(qian)有(you)(you)(you)寬大(da)的(de)(de)平臺,叫(jiao)杏壇(tan)(tan),又叫(jiao)露壇(tan)(tan),傳(chuan)說是(shi)(shi)(shi)孔(kong)(kong)子(zi)講學(xue)的(de)(de)地方(fang)。露壇(tan)(tan)之上(shang)(shang)是(shi)(shi)(shi)大(da)成(cheng)(cheng)(cheng)(cheng)殿(dian)(dian),為(wei)(wei)文廟(miao)的(de)(de)主(zhu)體建筑,面(mian)闊五(wu)間(jian)(jian),進深三(san)間(jian)(jian),有(you)(you)(you)磚柱十(shi)(shi)根,木(mu)柱十(shi)(shi)八(ba)根,大(da)門(men)(men)十(shi)(shi)四(si)(si)扇(shan),門(men)(men)窗、檐(yan)口均(jun)飾(shi)以木(mu)雕(diao)。屋面(mian)飛檐(yan)高翹,重(zhong)檐(yan)歇山,脊(ji)施花(hua)飾(shi),泥塑彩畫,琉璃(li)瓦蓋,金碧輝(hui)煌。大(da)成(cheng)(cheng)(cheng)(cheng)殿(dian)(dian)正中(zhong)的(de)(de)神龕是(shi)(shi)(shi)供奉(feng)孔(kong)(kong)子(zi)靈(ling)牌的(de)(de)地方(fang)。大(da)成(cheng)(cheng)(cheng)(cheng)殿(dian)(dian)之后(hou)是(shi)(shi)(shi)崇圣祠,是(shi)(shi)(shi)供奉(feng)孔(kong)(kong)子(zi)五(wu)代祖先(xian)的(de)(de)殿(dian)(dian)堂(tang),崇圣祠與大(da)成(cheng)(cheng)(cheng)(cheng)殿(dian)(dian)在建筑構造上(shang)(shang)很講究,大(da)小高低有(you)(you)(you)分別。
歷代(dai)每歲春仲月(農歷二、八月),在大殿(dian)舉行祭(ji)禮。祭(ji)期(qi)黎明(ming),各(ge)官衣(yi)朝服,按序而立(li),齊集行禮,典(dian)儀(yi)極(ji)為隆重。
據資(zi)料記載,道光(guang)二(er)十二(er)年(nian)(1842年(nian)),有人認為(wei)原(yuan)廟室規模(mo)小,出不了狀元,于是官府派遣王(wang)雁洲、莫勵(li)堂兩位舉人到山東曲(qu)阜(fu)參觀孔(kong)(kong)廟,以(yi)曲(qu)阜(fu)孔(kong)(kong)廟為(wei)模(mo)式設計繪圖,籌集巨款,并從(cong)廣東、湖南等地請來工(gong)匠重建(jian),歷時(shi)兩年(nian)余始告(gao)竣工(gong),成為(wei)廣西較大的孔(kong)(kong)廟。清咸豐四年(nian)(1854年(nian))又毀于兵燹,清咸豐十一年(nian)(1861年(nian))重新修復。以(yi)后曾修葺二(er)十多次(ci)。1963年(nian)廣西壯族自治區人民政府撥款維修,并列為(wei)自治區重點文物保護單(dan)位。