文介绍在mac中利用android来访问,自己在本地搭建服务器!(新手新篇,若有不好多多包涵)
第一部分:下载和安装XAMPP
XMAPP下载官网
选择os X,记得选择mysql的版本
XAMPP的界面显示
配置config.ic.php中的代码
该文件在我的电脑上的绝对路径:
/Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php
代码修改:
//这里代码的修改需要给读和写的权限,在‘显示简介’中修改权限
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';//config表示直接读取配置的信息 使用http是使用网页框登录信息
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
第二部分下载和安装tomcat服务器
使用工具brew的包管理工具,可以很方便地进行安装/卸载/更新各种软件包。brew官网
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装软件,如:brew install oclint
卸载软件,如:brew uninstall oclint
搜索软件,如:brew search oclint
更新软件,如:brew upgrade oclint
查看安装列表, 如:brew list
更新Homebrew,如:brew update
使用brew安装tomcat:
brew install tomcat 然后一直回车就okk。
对于web部署的项目下需要将对应的war(它减少了传输文件所需要的时间)放到下面这个路径中。
/usr/local/Cellar/tomcat/9.0.27/libexec/webapps
然后启动startup.sh(类似于win中的bat批处理)
/usr/local/Cellar/tomcat/9.0.27/libexec/bin/startup.sh
启动tomcat
第三部分android的应用
这里的ip地址是本地的ip,使用terminal中的ifconfig查看