最近我将我的开发框从windows更改为linux。我试图在我的linux(mint 18.2)盒子上设置一个yii2站点。以前,我使用xampp在Windows 7机器上运行该网站。将yii2网站从windows迁移到linux,断开链接
这是我在我的造币箱(/etc/apache2/site-available/tripcopilot.com)上的虚拟主机文件。
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mysite.dev
ServerAlias www.mysite.dev
DocumentRoot /var/www/mysite/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我还添加以下行到我的hosts文件
127.0.0.1 mysite.dev
然后我启用了使用
a2ensite mysite.dev.conf
到目前为止,在此设置的网站,我可以去我的浏览器, http://mysite.dev带我到我的主页,但当我尝试导航到网站上的任何其他页面时,我收到“找不到页面”错误。
我想这可能有一些做的事实,我使用漂亮网址...这里是yii2
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [
"home" => "site/index",
"login" => "site/login",
"sign-up" => "site/sign-up",
"search" => "site/search"
],
],
我urlManager组件安装在这之后我检查我的Apache设置,看是否我允许.htaccess文件。这是当前的设置(/etc/apache2/apache2.conf)。
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
所以我把它改成下面
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
但现在,当我去mysite.dev我得到一个“内部服务器错误”。下面是从/var/log/apache2/error.log
[Tue Oct 17 15:30:37.366255 2017] [core:alert] [pid 17889] [client 127.0.0.1:41082] /var/www/mysite/web/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
日志条目有什么我忘了在我的设置呢?任何帮助将不胜感激。谢谢
Stack Overflow是编程和开发问题的网站。这个问题似乎与题目无关,因为它不涉及编程或开发。请参阅帮助中心的[我可以询问哪些主题](http://stackoverflow.com/help/on-topic)。也许[超级用户](http://superuser.com/)或[Unix&Linux堆栈交换](http://unix.stackexchange.com/)会是一个更好的地方。 – jww