Apache應用實例:建立yum服務器

 

Apache應用實例:建立yum服務器
服務器端配置
1.     安裝Apache
iso文件拷貝至本機,並建立本地安裝yum
vi /etc/fstab
/iso/rhel-server-6.0-x86_64-dvd.iso     /mnt/iso   iso9660   defaults,loop   0 0
vi /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///mnt/iso
enable=1
gpgcheck=0
測試yum
 
Yum安裝Apache http服務器
yum install httpd* -y
啓動並驗證httpd服務
/etc/init.d/httpd start
 
2.配置yum服務器端
爲了能夠使外部主機能夠訪問服務器,須要進行防火牆設置。
system-config-firewall-tui 在防火牆開啓80端口
使用局域網內其他主機進行測試
/var/www/html目錄下建立rhel6目錄並附帶權限。
mkdir -p /var/www/html/rhel6
掛載光盤並且將rhel6光盤中的Server目錄中的內容全部複製到/var/www/html/rhel6中。
mount /dev/sr0 /mnt/cdrom
cp –R /mnt/cdrom/Server /var/www/html/rhel6
重新啓動httpd服務,並且設置開機啓動httpd服務。
/etc/init.d/httpd restart
chkconfig   httpd on
 
3.配置yum服務器客戶端
vi /etc/yum.repos.d/local.repo
[http]
name=http
baseurl=http://192.168.0.1/rhel6/Server/ url在瀏覽器中驗證正確後再複製到此。
enable=1
gpgcheck=0
驗證:
yum info httpd
若出現相關軟件包信息介紹,則說明服務器搭建成功。
 
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章