walkor / webman

Probably the fastest PHP web framework in the world.
https://webman.workerman.net/
MIT License
2.15k stars 212 forks source link

I try to put robots.txt domain.com/robots.txt but it's conflicted with my route config #128

Closed haidarvm closed 3 years ago

haidarvm commented 3 years ago

here's my route Route::any('/{slug}/', 'app\controller\read@slug');

and i put robots.txt in public/robots.txt

so how to exclude robots.txt in Route::any('/{slug}/' ?

haidarvm commented 3 years ago

Ok meanwhile i just do this Route::any('/robots.txt', function ($request) { return response('User-agent: *'); });

walkor commented 3 years ago

Another way.

Route::any('/robots.txt', function ($request) {
    return response()->withFile(public_path().'/robots.txt');
});
Route::any('/{slug}/', 'app\controller\read@slug');
walkor commented 3 years ago

It seems that there is something wrong with line 31 of your /home/client/beritainspiratif/new/app/controller/read.php.

walkor commented 3 years ago

If you think the result is cached, please run the command ps auxf to see if two webman have been started. If two webman have been run, turn off the redundant ones.

haidarvm commented 3 years ago

yes it's exactly always got two

root        1170  0.0  0.8 732828 17824 ?        S    Jan28   0:16  \_ WorkerMan: worker process  webman http://roemahmedia.com:8181
root        1174  0.0  0.8 732312 18160 ?        S    Jan28   0:17  \_ WorkerMan: worker process  webman http://roemahmedia.com:8181
root        1171  0.0  0.6 730236 12904 ?        S    Jan28   0:00  \_ WorkerMan: worker process  webman http://admin.kitabemas.or.id:8787
root        1184  0.0  0.5 730236 11528 ?        S    Jan28   0:00  \_ WorkerMan: worker process  webman http://admin.kitabemas.or.id:8787
root       21411  0.0  0.8 734332 17504 ?        S    Jan28   0:15  \_ WorkerMan: worker process  webman http://beritainspiratif.com:8383
root       22261  0.0  0.9 735068 18420 ?        S    Jan28   0:16  \_ WorkerMan: worker process  webman http://beritainspiratif.com:8383
root       11588  0.0  0.9 734348 19684 ?        S    Jan28   0:16  \_ WorkerMan: worker process  webman http://beritainspiratif.com:8383
root       11589  0.0  0.9 734348 19352 ?        S    Jan28   0:16  \_ WorkerMan: worker process  webman http://beritainspiratif.com:8383
root       25125  0.0  0.9 734360 18968 ?        S    Jan28   0:16  \_ WorkerMan: worker process  webman http://beritainspiratif.com:8383
root       25126  0.0  1.0 734872 20316 ?        S    Jan28   0:16  \_ WorkerMan: worker process  webman http://beritainspiratif.com:8383

how to turn it off ?

walkor commented 3 years ago

Use command kill -9 pid for example kill -9 1170.

haidarvm commented 3 years ago

Use command kill -9 pid for example kill -9 1170.

no please webman is strange, if I kill those ID it created again by self so, it's always auto generate webman service, please help me can i contact you by chat ?

walkor commented 3 years ago

Please run command ps auxf and show all the output.

walkor commented 3 years ago

Run command kill -SIGINT 25124 kill -SIGINT 11587 kill -SIGINT 1053 kill -SIGINT 957 kill -SIGINT 837.

haidarvm commented 3 years ago

Ok after kill those all and run start -d i got two webman ps aux

client     91316  0.8  1.5 730248 31916 ?        S    12:55   0:00 WorkerMan: worker process  webman http://beritainspiratif.com:8383
client     91317  0.3  1.4 730248 29584 ?        S    12:55   0:00 WorkerMan: worker process  webman http://beritainspiratif.com:8383
client     91332  0.0  0.0 221912  1116 pts/0    R+   12:55   0:00 grep --color=auto webman
walkor commented 3 years ago

Please run command ps auxf and show all the output.

walkor commented 3 years ago

It' ok now.

haidarvm commented 3 years ago

so if i wanna kill, i do the master prosess

client     91428  0.0  1.0 725964 21336 ?        S    12:57   0:00 WorkerMan: master process  start_file=/home/client/kitabemas/start.php

kill -SIGINT 91428 right ?

walkor commented 3 years ago

Yes. And another way is run command ‘php start.php stop’.

haidarvm commented 3 years ago

Ok thanks alot for your help

haidarvm commented 3 years ago
[root@haidarvm new]# php start.php stop
Workerman[start.php] stop 
Workerman[start.php] not run
[root@haidarvm new]# ps aux | grep webman
root        1218  0.0  1.4 734352 30232 ?        S    07:03   0:13 WorkerMan: worker process  webman http://beritainspiratif.com:8383
root        1220  0.0  1.0 728184 20376 ?        S    07:03   0:00 WorkerMan: worker process  webman http://admin.kitabemas.or.id:8787
root        1221  0.0  1.4 734340 30068 ?        S    07:03   0:13 WorkerMan: worker process  webman http://beritainspiratif.com:8383
root        1222  0.0  0.9 728184 20264 ?        S    07:03   0:00 WorkerMan: worker process  webman http://admin.kitabemas.or.id:8787
root        1230  0.0  1.1 730240 24116 ?        S    07:03   0:01 WorkerMan: worker process  webman http://roemahmedia.com:8181
root        1237  0.0  1.3 732288 27444 ?        S    07:03   0:01 WorkerMan: worker process  webman http://roemahmedia.com:8181
root       14760  0.0  0.0 221912   976 pts/0    R+   16:43   0:00 grep --color=auto webman

i can't do php start.php stop

why ?