Mac快速搭建http,ftp服务器

来源:互联网 发布:linux远程控制mingling 编辑:程序博客网 时间:2024/05/29 12:55

一、原因

  有时候在学习或者工作的时候需要一个web或者ftp服务器,而mac本身就携带web和ftp服务器的功能

二、WEB服务器搭建

  1)开启命令:sudo apachectl start /restart

         2) 关闭命令:sudo apachectl stop

         3)服务器默认页面路径:/Libiary/WebServer/Documents

         4)服务器配置文件:/etc/apache2/httpd.conf  

               可修改端口

        定义DocumentRoot,服务器根路径,

 定义DirectoryIndex,默认文件,另外还有错误日志文件等

         5)查看apache版本:sudo apachectl -v

三、FTP服务器

1)开启命令:sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

         2) 关闭命令:sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

  设置开机自启:编辑ftp.plist文件

<dict>

<key>Disable</key> //修改为Enabled

四、

五、

原创粉丝点击