Ap index is a daily measure of geomagnetic activity. In many reference atmospheric models, geomagnetic storm effects are modeled using Ap index as the driver of global density changes. Ap index is often used in making space mission plans because of the geomagnetic activity effects, and the forecasting of the Ap index plays an important role in space environment prediction. In the present study, the modified autoregressive model is used to forecast the Ap index 27 days ahead. In the modified model, the input data were reconstructed based on the 27-days periodicity of the solar rotation. The average absolute error between the forecasted and observed geomagnetic Ap index is 4.5. For short-term Ap forecasting (3-days ahead in this paper), a new forecasting index Pch derived from the SOHO/EIT EUV images is used. Pch index is a parameter which can reflect both the area and brightness of coronal holes. Because the high speed stream will arrive at the earth orbit and cause geomagnetic disturbances about 3 days later after a coronal hole passes over the center meridian of the solar disk, the parameters of coronal holes can be used to forecast the geomagnetic disturbances. The average absolute error between the forecasted and observed geomagnetic Ap index is 3.7. According to the results of medium term and short term forecasting, the prediction accuracy can be improved by combining the statistical method with the physical analysis above.