在mex6上使用腳本自動(dòng)創(chuàng)建nginx+php的容器部署kodexplorer和dzoffice.
dzoffice安裝配置好了數(shù)據(jù)庫后,進(jìn)入首頁時(shí)報(bào)錯(cuò):
*150 directory index of "/usr/share/nginx/html/" is forbidden
kodexplorer之前也是報(bào)這個(gè)錯(cuò)誤,一直覺得是不是容器部署有問題?
看到這個(gè)錯(cuò)誤重現(xiàn)了以后,搜索了一下,大部分都是說nginx配置文件導(dǎo)致的——沒有配置index.php這個(gè)路勁為默認(rèn)首頁,最后由于沒有index.html,所以找不到頁面。
不忙著修改配置文件,現(xiàn)在域名后面直接加上 /index.php ,果然可以登錄進(jìn)入首頁!
最后在nginx配置文件中加上:
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}
再像容器中更新下配置文件和重啟nginx,好了
1056 var=_data_phpnginx_kod432
1057 docker cp ./${var}.conf myNginx_${var}:/etc/nginx/conf.d/default.conf
1058 docker exec -it myNginx_${var} /bin/bash -ic "service nginx reload"
1059 var=_data_phpnginx_dzzoffice
1060 docker cp ./${var}.conf myNginx_${var}:/etc/nginx/conf.d/default.conf
1061 docker exec -it myNginx_${var} /bin/bash -ic "service nginx reload"