按照 https://github.com/iiYii/getyii 上面的原始安装方法安装完成,安装在 /var/www/getyii 位置
The requested URL /getyii/frontend/web/getstart was not found on this server.
[jason@kali:~]$ grep -v '^#' /etc/apache2/apache2.conf | sed '/^\s*$/d'
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
[jason@kali:~]$ cat /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
@forecho 帮忙看看呗:)
配置一下 vhost 和伪静态吧,别这么懒。
如果不配置你试一下这个地址: http://localhost:8080/getyii/frontend/web/index.php?r=site/signup
应该是这个地址
这三个链接访问的都是:http://localhost:8080/getyii/frontend/web/index.php?r=site/index
vhost和伪静态如何配置,请问是否有教程? 其实,比较意外的是,完全按照Github官方文档《原始安装方法》逐步操作完成后,竟然不成功。。
看一下这里 http://www.getyii.com/doc-2.0/guide/start-installation.html#apache
可能是因为我设置了 urlManager
有关系吧
@wfm2008124 #4楼 我按照你说的将enablePrettyUrl关闭掉,确实链接都正常了。 但是,原本应该打开才是期望的效果啊,现在关了URL都变成了Yii的默认形式:http://localhost:8080/getyii/frontend/web/index.php?r=topic 这并不是期望的效果
@wfm2008124 @forecho 找到具体原因了:)
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
# 下面这一句必须允许覆盖,不能写None,要使用All,源程序中的.htaccess中的配置无法生效!
AllowOverride All
Order allow,deny
allow from all
</Directory>