1. Specific description of the issue
I set up the Appache server under CENTOS7, then I wrote the daemon and the front page, now I want to use my notebook to build a hotspot, and then use my phone to connect and access my website. I tried it and found that either the page was not found or the number of visitors was too large or inaccessible (but on my computer I could access my site). The heart is very cold ~
2. Tools used during the period
The system is CENTOS7, the server is Appache, uses the C to write the CGI backstage program, writes the front page with the HTML5.
3. How can I access it?
I consider the firewall is not a ban on the outside of my website access, later Baidu, found a solution.
Switch root mode, enter the shell command: firewall-cmd--permanent--add-service=http (meaning firewall permanently open HTTP service)
Then, restart Firewall-cmd:firewall-cmd--reload
In addition, the following is my httpd.conf configuration, mainly three parts, one is to set up my WiFi hotspot monitoring (after all, to my computer as a server), one is to open/var/www/html, there is a/var/www/cgi-bin,
Because I want to access my Web page and background program.
Part 1
# # Listen:allows-bind Apache to specific IP addresses and/or# ports,12.34.56.78:8010.42 .0.1:80 #告诉內网其他设备, my host IP is 10.42.0.1, website port 80, this IP is the IP of my wifi module
Part 2
# Further relax access to the default document Root:<directory"/var/www/html"> # # Possible values for the Options Directive is"None", "all",# or any combination of: # Indexes includes followsymlinks symlinksifownermatch execcgi multiviews # # Note that"MultiViews" must is named *explicitly*---"Options all"# doesn ' t give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes followsymlinks # # AllowOverride Controls What directives is placed in. htaccess files. # It can be"All", "None",or any combination of the keywords: # Options FileInfo authconfig Limit # allowoverride None Order allo W,deny # # Controls who can get stuff from the this server. # # Require All granted allow from all</directory>
Part 3
"/var/www/cgi-bin" should is changed to whatever your scriptaliased# CGI directory exists,"/var/www/ Cgi-bin "> allowoverride None Options execcgi #执行CGI Orderallow,deny allow From all AddHandler default-handler .css</directory>
After you change the configuration, restart the Appache server: systemctl restart httpd
4. Notes
If there is any problem, many advice, thank you.
Problem: The mobile phone cannot access the Web site on the same LAN as the computer (has been resolved)