mac 部署 apache
来源:互联网 发布:侠客风云传优化补丁 编辑:程序博客网 时间:2024/06/05 04:30
- 创建个人站点目录
cd ~/mkdir Sites
创建成功后再在 用户/[你的用户名]/Sites 目录下创建log目录和index.html文件
- 请检查”/etc/apache2/users”目录下,是否有名为“maomao.conf”的配置文件(同样:maomao需换成你的mac用户名),如果没有,手动创建一个,内容参考下面:(Directory的maomao替换掉)
<Directory "/Users/maomao/Sites/"> Options FollowSymLinks Indexes MultiViews AllowOverride All Order allow,deny Allow from all</Directory>
- sudo vi /etc/hosts 以管理员身份打开hosts文件,追加一行
127.0.0.1 www.maomao.com
- 启用虚拟主机
默认情况下,apache的虚拟主机功能是关闭的,在“/etc/apache2/httpd.conf”中找到下面这行:
#Include /private/etc/apache2/extra/httpd-vhosts.conf
将前面的#去掉,然后再打开“/etc/apache2/extra/httpd-vhosts.conf”,内容修改成类似下面的样子:(maomao改成你的mac用户名)
# Virtual Hosts## Required modules: mod_log_config# If you want to maintain multiple domains/hostnames on your# machine you can setup VirtualHost containers for them. Most configurations# use only name-based virtual hosts so the server doesn't need to worry about# IP addresses. This is indicated by the asterisks in the directives below.## Please see the documentation at# <URL:http://httpd.apache.org/docs/2.4/vhosts/># for further details before you try to setup virtual hosts.## You may use the command line option '-S' to verify your virtual host# configuration.## VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for all requests that do not# match a ServerName or ServerAlias in any <VirtualHost> block.##<VirtualHost *:80># ServerAdmin webmaster@dummy-host.example.com# DocumentRoot "/usr/docs/dummy-host.example.com"# ServerName dummy-host.example.com# ServerAlias www.dummy-host.example.com# ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"# CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common#</VirtualHost>#<VirtualHost *:80># ServerAdmin webmaster@dummy-host2.example.com# DocumentRoot "/usr/docs/dummy-host2.example.com"# ServerName dummy-host2.example.com# ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"# CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common#</VirtualHost><VirtualHost *:80> DocumentRoot "/Library/WebServer/Documents" ServerName localhost ErrorLog "/private/var/log/apache2/localhost-error_log" CustomLog "/private/var/log/apache2/localhost-access_log" common</VirtualHost><VirtualHost *:80> DocumentRoot "/Users/maomao/Sites" ServerName www.maomao.com ErrorLog "/Users/maomao/Sites/log/error.log" CustomLog "/Users/maomao/Sites/log/access.log" common <Directory /> Options Indexes FollowSymLinks MultiViews AllowOverride None Order deny,allow Allow from all </Directory></VirtualHost>
- 修改private/ect/apache2/http.conf
(这一步很重要,否则会报权限错误)
<Directory /> AllowOverride none #Require all denied allow from All</Directory>
- 启动服务器
udo apachectl start
- 访问www.maomao.com即可
0 0
- mac 部署 apache
- Mac Apache Django WSGI 部署
- mac apache 服务器部署资源局域网访问
- Mac下Django通过WSGI部署到Apache
- Mac上Apache部署本地PHP工程虚拟地址
- apache部署
- Apache部署
- Mac apache
- Mac apache
- Mac apache
- Mac apache
- mac系统在apache上部署php项目,无法访问的问题。
- Xamarin MAC部署
- mac appium环境部署
- mac ngixn 安装部署
- MAC svn 部署
- mac部署electron过程
- mac单机部署spark
- 团队管理论总括
- 发现一些个人开发者应用
- 解决Qt 运行错误 错误代码 : code -1073741571
- MD5实现小应用
- 浅析linux kernel段错误及调试手段
- mac 部署 apache
- 黑马程序员--NSString
- 找出数组中第二大的数
- 【数论】[CQBZOJ2935]病毒分裂
- Magento模块开发手册(二)magento的配置
- 2-SAT
- Grubbs算法检测离群值
- 在storyBoard中添加UIScrollView并添加相应的约束
- Magento模块开发手册(三)magento控制器调度