首页 > 服务器 > hg255d刷openwrt后安装web服务

作者:ghostry 发布时间:2012-10-26 浏览: 8960

转载注明出处: https://blog.1ge.fun/server/hg255d%E5%88%B7openwrt%E5%90%8E%E5%AE%89%E8%A3%85web%E6%9C%8D%E5%8A%A1.html

显示按照这里做的
http://tieba.baidu.com/p/1112340974
结果发现lighttpd-mod-fastcgi源里没有...
很郁闷.
后来想到web管理界面已经有了web服务,就搜索看能不能和php连起来.
http://www.vinoca.org/2012/04/03/openwrt%E6%9E%B6%E8%AE%BEuhttpdphpsqlite%E7%BD%91%E7%AB%99/
果然被我找到了.
结果就是
opkg install php5-fastcgi php5-mod-mysql mysql-server libncurses php5-mod-gd php5-mod-xml php5-mod-session
之后修改uhttpd
把luci的端口改成别的.
然后
在文件最后添加

config uhttpd web
list listen_http 0.0.0.0:80
option home /www/html
option index_page index.php
list interpreter ".php=/usr/bin/php-fcgi"

修改/etc/php.ini
doc_root = "/www/html"
extension=pdo.so
extension=pdo-mysql.so
extension=mysql.so
extension=gd.so

upload_tmp_dir = "/mnt/opkg/tmp"
upload_max_filesize = 20M

然后
建立php文件
phpinfo();
?>

mysql配置
修改my.cnf文件
datadir = /希望的路径/
tmpdir = /希望的路径/

创建数据库
/usr/bin/mysql_install_db --force
启动
/etc/init.d/mysqld start
设置密码
mysqladmin -u root password 00000000
登陆
mysql -u root -p
使用mysql库
use mysql;
查看host
select 'host' from user where user='root';
修改为所有主机
update user set host = '%' where user ='root';
更新
flush privileges;
查看
select 'host' from user where user='root';

标签: web openwrt uhttpd extension option index root www root

上一篇: discuz 6 数据调用 主题列表出错
下一篇: o(∩_∩)o 哈哈

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: