您的位置:首页 > 运维架构 > Apache

apache操作

2016-04-07 17:31 519 查看
1.修改网站根目录

1.1 mac上

sudo vim /etc/apache2/httpd.conf
DocumentRoot "/Users/yesiming/work/phpstorm/p1"
<Directory "/Users/yesiming/work/phpstorm/p1">

1.2 ubuntu上(apt-get安装不会出现httpd.conf文件)
sudo vim /etc/apache2/apache.conf
sudo vim /etc/apache2/sites-available/000-default.conf
修改目录后要注意权限 (命令: chmod 644 index.html)

-rw-r----- 1 root root  21 Apr  9 15:01 index.html 
-rw-r--r-- 1 root root 12K Apr  9 13:21 index.html.bak

index.html 的权限会导致访问权限不足

必须改成 index.html.bak 的权限 (其它用户可读)

2.启动apache

sudo apachectl -k start
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  apache