请教一下各位大佬,./WebServer之后要怎么做
I have seen this project, you can use it as the following steps:
- Start the server:
./WebServer -t 4 -p 8888 -l /data/lzr/ProgramFiles/cplusplus/WebServer/MyLog/log1.log - Start the client:
./HTTPClient
Notes: as the port has been fixed in
./WebServer/tests/HTTPClient.cpp, you could not change the port in server.
Thank you for your explanation, I would like to ask another question! After starting the client: ./HTTPClient the command line output: 1: strlen(p) = 1 n=0 err2: Connection refused err3: Connection refused At the same time the server also output: Segmentation fault (core dumped)
Thank you for your explanation, I would like to ask another question! After starting the client: ./HTTPClient the command line output: 1: strlen(p) = 1 n=0 err2: Connection refused err3: Connection refused At the same time the server also output: Segmentation fault (core dumped)
I think you could check if the port has been used, and select a avaliable port. In my environment, it just outputs some normal result, no Segmentation fault (core dumped).
Thanks for your response again. I figured out the problem. After changing the index after -l, the output is normal now.
./WebServer -t 4 -p 8888 -l /data/lzr/ProgramFiles/cplusplus/WebServer/MyLog/log1.log ---> ./WebServer -t 4 -p 8888 -l /home/terrfg/log1.log
My client’s output is the same as yours.
My server outputs "Resource temporarily unavoidable" Do you have the same output in your server? If the output in my server is not normal, i will continue to find my problems.
You can type chinese as I am a Chinese. As far as I know, there are two main problems in this project:
- As there are no html file in the build folder, you should create a
index.html(where content could be anything) in the folder like that:
2. You need to modify the code as follows:
谢谢大佬的指导!!! 我想我可以继续我下一步的学习了!