/* 本類型帖子解決問題:幫助搜索引擎使用能力較弱的技術人員解決一些實際問題。內容很基礎。 */
需求
內網服務器上部署一個ftp server後,引起了ftp文件下載的需求,希望可以搭建一個web server,方便員工可以通過網頁快速瀏覽、下載文件。
實現
- 原材料
apache/httpd
Red Hat 4.8.5
- 參考鏈接
LINK1:https://blog.csdn.net/yejinxiong001/article/details/77527189
LINK2:https://blog.csdn.net/u010297957/article/details/50751656
- 操作步驟
1、安裝httpd
#建議切換到root賬戶
yum list httpd
#選中httpd的版本
yum install httpd.x86_64
2、修改httpd.conf,更新服務監聽端口
vim /etc/httpd/conf/httpd.conf
#找到Listen 80這一行,把80改成想要的端口
#保存退出
2.1、參考LINK2中的第四點增加開機自啟動
3、啟動httpd
service start httpd
3.1、啟動異常的話...
systemctl status httpd.service
3.2、啟動成功後在瀏覽器測試
URL:http://10.10.2.1:58080
顯示下圖表示OK了
![[水帖]apacke配置ftp下載目錄並完成簡單配置](http://p2.ttnews.xyz/loading.gif)
4、修改配置
#修改文件權限和根目錄
vim /etc/httpd/conf/httpd.conf
把
<directory>
Options FollowSymLinks
AllowOverride none
Require all denied
把“Require all denied”修改為“allow from all”
修改DocumentRoot的指向,比如我的ftp文件root為/home/ftp,改為“/home”
#修改mod_autoindex的一些配置
比如我們的文件名稱會比較長,需要全部顯示
vim /etc/httpd/conf.d/autoindex.conf
把“# IndexOptions FancyIndexing HTMLTable VersionSort”修改為“IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=*”
5、重啟httpd
service restart httpd
閱讀更多 poisson 的文章