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

apache 站点配置

2017-02-08 14:44 405 查看
新建虚拟主机

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName ubuntuuc.cc
ServerAlias ubuntuc.cc
DocumentRoot /vagrant/public/uc/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


修改hosts

127.0.0.1 ubuntuuc.cc


开启主机重写(.htaccess)支持

sudo a2enmod  rewrite
sudo vim /etc/apache2/mods-enabled/rewrite.load #进去开启


修改apache配置文件

<Directory />
Options FollowSymLinks
AllowOverride All #All才会使用带主机重写
Require all granted #granted才能访问到网站
</Directory>


重启apache2

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