标签:grant 启动 release http ted gre png writer request
1.下载Yii2
https://github.com/yiisoft/yii2/releases/download/2.0.11/yii-basic-app-2.0.11.tgz
2.将解压后的文件放在指定的位置,这里是/home/www/yii/
3.安装apache2
sudo apt-get iinstall apache2
3.启动和查看apache2
启动:
sudo /etc/init.d/apache2 start
查看:
ps -ef |grep "apache"
4.配置虚拟主机 www.feiquan.com
sudo touch /etc/apache2/sites-enabled/www.feiquan.com.conf
sudo vim/etc/apache2/sites-enabled/www.feiquan.com.conf
<VirtualHost *:80> ServerName www.feiquan.com DocumentRoot /home/www/yii/web <Directory " /home/www/yii/web"> Require all granted Allow from all RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php </Directory> </VirtualHost>
5.配置hosts文件(记得这里是hosts不是host)
ifconfig
得到IP地址 192.168.0.100
sudo vim /etc/hosts
在其中添加IP和域名
192.168.0.100 www.feiquan.com
6.重启apche2服务(失败)
sudo /etc/init.d/apache2 start
需要启动apache2的rewrite模块
sudo a2enmod rewrite
然后重启apche2服务
7.然后打开浏览器,查看www.feiquan.com
可以看到提示,是PHP语言
8.安装apache2的PHP模块
sudo apt-get install libapache2-mod-php
然后重启apache服务
9.打开浏览器刷新www.feiquan.com
然后可以看到YII的报错信息
标签:grant 启动 release http ted gre png writer request
原文地址:https://www.cnblogs.com/feiquan/p/10775661.html