Several pages were developed today, but some of the HTTP interfaces on the page were called to render the page, because of cross-domain issues, but did not want to make the JSONP way, so get an Apache HTTP server to toss. This applies only to Linux
1. Download Apache httpd from Apache
2. After downloading the installation directory, open the httpd.conf configuration file of the Conf folder to modify
3. First modify the listen port such as 8081, after the change to save (because the default 80 ports may be occupied, so modify their own definition)
Listen 8088
4. Open the httpd boot of the bin folder in the installation directory
./httpd-x
5. Open the browser input localhost:8088, you can find it works! Hint, this means the boot was successful.
But if I need to replace some of my static HTML pages and JS, such as I have a static page project WebApp, I put to/usr/local/apache2/webapp (of course, I can specify to put in other directories)
So open httpd.conf and find the following
documentroot "/usr/local/apache2/htdocs" <Directory "/usr/local/apache2/htdocs" > # # possible values for the options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch execcgi multiviews # # note that "MultiViews " must be named *explicitly* --- " options all " # &NBSP;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 may be placed in .htaccess files. # it can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride None # # controls who can get stuff from this server. # Require all granted</Directory>
Replace/usr/local/apache2/htdocs with/usr/local/apache2/webapp
documentroot "/usr/local/apache2/webapp" <Directory "/usr/local/apache2/webapp" > # # possible values for the options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch execcgi multiviews # # note that "MultiViews " must be named *explicitly* --- " options all " # &NBSP;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 may be placed in .htaccess files. # it can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride None # # controls who can get stuff from this server. # Require all granted</Directory>
After saving, restart httpd again to access the other normally.
How the front-end Web development HTML avoids JS cross-domain access