安装问题, 注册 404

By scola2 at 2017-01-16 • 0人收藏 • 3476人看过

安装完成了, 注册 404,

看了这个站的安装问题, 都说是 rewrite 没有开启, 但是我的已经开启了, 不知道哪里出了问题,


系统:ubuntu, 搬瓦工 虚拟主机

scola2@default:/etc/apache2$ sudo a2enmod rewrite
Module rewrite already enabled




scola2@default:/etc/apache2/mods-enabled$ ls
access_compat.load  auth_basic.load  authz_core.load  autoindex.conf  deflate.load  env.load      mime.conf         mpm_prefork.load  php5.conf     setenvif.conf  status.load
alias.conf          authn_core.load  authz_host.load  autoindex.load  dir.conf      filter.load   mime.load         negotiation.conf  php5.load     setenvif.load
alias.load          authn_file.load  authz_user.load  deflate.conf    dir.load      headers.load  mpm_prefork.conf  negotiation.load  rewrite.load  status.conf





scola2@default:/etc/apache2$ cat sites-enabled/000-default.conf
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/Carbon-Forum-5.6.1
        RewriteEngine On
        RewriteOptions Inherit

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
        <Directory /var/www/Carbon-Forum-5.6.1>
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

@lincanbin 帮忙看下, 麻烦了, 多谢

11 个回复 | 最后更新于 2017-01-18
2017-01-16   #1

另外,目前没有域名, http://server-ip/register

这样的

2017-01-16   #2

自己部署环境,一般最容易遇到的问题,除了rewrite没开,就是权限没给。

如果你没给执行php的www用户程序所在目录的读写权限的话,那么配置文件是无法写入的,包括.htaccess文件也是没办法写入的。

可以试试把程序所在目录的owner递归为apache的执行用户(一般是www),或者递归给777权限。


2017-01-16   #3

回复#2 @lincanbin :

谢谢回复, 我把 /var/www/Carbon-Forum-5.6.1 目录权限 改成 777 了, 还是 404

另外我问一下, .htaccess 这个文件在哪里么, 目录里面没有找到

2017-01-16   #4

回复#3 @scola2 :

改完重装

2017-01-16   #5

回复#4 @lincanbin :

安装, 注册成功了, 多谢指导 ^_^

2017-01-16   #6

回复#4 @lincanbin :

另外提个建议,

1. 帖子回复数到 20 就分页, 是不是少了点, 个人比较喜欢github issue 那种不分页,或者100 个回复才分页


2. 手机端, 网页上下滑动非常容易触动左划,能不能把滑动拉出菜单禁掉

2017-01-16   #7

回复#6 @scola2 :

20的分页数后台可设置的。

2017-01-16   #8

回复#7 @lincanbin :

头像无法修改, log 有异常


[Mon Jan 16 02:16:55.165504 2017] [:error] [pid 4137] [client 104.160.38.77:51520] PHP Warning:  include(/var/www/Carbon-Forum-5.6.1/config.php): failed to open stream: No such file or directory in /var/www/Carbon-Forum-5.6.1/common.php on line 24
[Mon Jan 16 02:16:55.165545 2017] [:error] [pid 4137] [client 104.160.38.77:51520] PHP Warning:  include(): Failed opening '/var/www/Carbon-Forum-5.6.1/config.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/Carbon-Forum-5.6.1/common.php on line 24
[Mon Jan 16 02:17:15.694201 2017] [:error] [pid 4137] [client 104.160.38.77:52835] PHP Warning:  touch(): Unable to create file install.lock because Permission denied in /var/www/Carbon-Forum-5.6.1/install/index.php on line 92, referer: http://104.224.170.122/install/
[Mon Jan 16 02:17:15.694976 2017] [:error] [pid 4137] [client 104.160.38.77:52835] PHP Warning:  touch(): Unable to create file ../update/update.lock because Permission denied in /var/www/Carbon-Forum-5.6.1/install/index.php on line 95, referer: http://104.224.170.122/install/
[Mon Jan 16 02:19:15.055111 2017] [:error] [pid 4137] [client 104.160.38.77:60205] PHP Fatal error:  Call to undefined function imagecreatefrompng() in /var/www/Carbon-Forum-5.6.1/includes/ImageResize.class.php on line 77, referer: http://104.224.170.122/settings

2017-01-16   #9

回复#8 @scola2 :

Call to undefined function imagecreatefrompng() 

意味着你没有安装PHP默认就应该有的GD2库,所以调不到这个系统函数。

2017-01-16   #10

回复#9 @lincanbin :

好的, 我不会 PHP 代码, 所以不懂这个, 我安装一下试试

再次感谢

2017-01-18   #11

回复#10 @scola2 :

如果你是从apt里装的php的话,跑一下:

apt-get install php5-gd

 

登录后方可回帖

登 录
信息栏

Carbon Forum是一个基于话题的高性能轻型PHP论坛

下载地址:Carbon Forum v5.9.0
QQ群:12607708(QQ我不常上)

donate

手机支付宝扫描上方二维码可向本项目捐款

粤公网安备 44030602003677号
粤ICP备17135490号

Loading...