阿里云ubuntu系统+apache2+php搭建gitblog
Apache2以及PHP的安装这里就不介绍了,网上一大堆。唯一需要总结的就是gitblog安装过程中的问题需要解决。
我遇到的问题是无法生成404 Not Found
需要apache支持rewrite, 改动有三处
修改内容apache2.conf, 在末尾加上
立即学习“PHP免费学习笔记(深入)”;
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
修改 “AllowOverride None” 中的 “None” 为 “All”;
<code>Options FollowSymLinks AllowOverride All Require all denied </code>
在网站的根目录添加.htaccess,内容如下
<code>RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</code>版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了阿里云Ubuntu系统+Apache2+PHP搭建gitblog,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号