An error occurred while installing StartBBS in Ubuntu and a solution: Ubuntu12.04php-5.3.27mysql-5.1.68nginx-1.4.2 The following configuration is required before installation (app/config. php): $ config ['base _ url'] = 'HTTP: // www.linuxidc.com/'{}config}'index_page'{}'in
Error in installing StartBBS on Ubuntu and Solution
Ubuntu 12.04
Php-5.3.27
Mysql-5.1.68
Nginx-1.4.2
Before installation, perform the following configuration (app/config. php ):
$ Config ['base _ url'] = 'HTTP: // www.linuxidc.com /';
$ Config ['index _ page'] = 'index. php ';
2.1 Installation Error 404
Add
If (! -E $ request_filename ){
Rewrite ^ (. *) $/index. php? $1 last;
# Rewrite "^/(. *) $"/index. php last;
# Break;
}
As follows:
# Www.linuxidc.com
Server {
Listen 80;
Server_name www.linuxidc.com;
Location /{
Root/home/wzw/workstation/www/linuxidc.com;
Index. php index.htm index.html;
Autoindex on;
}
# Location =/50x.html {
# Root/home/wzw/workstation/www/linuxidc.com;
#}
Location ~ \. Php. * $ {
Root/home/wzw/workstation/www/linuxidc.com;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Include fastcgi_params;
If (! -E $ request_filename ){
Rewrite ^ (. *) $/index. php? $1 last;
# Rewrite "^/(. *) $"/index. php last;
# Break;
}
}
}
2.2 js and css files cannot be loaded, and the Error 404 is reported. The page data is normal, that is, the php part is normal.
This problem made me crazy for almost a day, mainly because I am not familiar with nginx.
This problem occurs because the location of the configuration added in 2.1 is critical. I previously put it in location /{...} And then try to put
Location /{...} And cause the same problem. Finally, I moved to location ~ \. Php. * $ {...} That's all.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2