Apache’s basic settings and garbled code solutions
one. Apache basic settings
1. The name of Apache's core configuration file is "httpd.conf", and the path where it is stored is the "X:Apache2conf" directory. After opening it with Notepad, modify it and then save it to configure the Apache server.
2. Since the configuration file "httpd.conf" determines the use of the entire Apahce server, be careful when modifying it! It is strongly recommended to make multiple backups first to prevent mistakes! If you really forget to back up, the system has also prepared a backup file named "httpd.default.conf" for you, which is the backup of "httpd.conf" automatically made by the system after you first installed Apache. You can use it by removing ".default".
3. Change the homepage path. The Apache homepage file is stored in the "X:Apachehtdocs" directory by default. If you want to change it to your own homepage file in the "E:mywebddj88" directory, open it with Notepad first. For the "httpd.conf" file in the "X:Apacheconf" directory, use the "Search" function in the "Edit" menu to find the sentence "DocumentRoot "x:/Apache/htdocs"", and then replace the "X:/Apache/htdocs" is changed to "E:/myweb/ddj88".
4. Change the default homepage file name. Apache's default homepage only has one "index.html". If yours is not, find the "DirectoryIndex index.html" line. The file called by default is placed here! Add your "index.htm" and other types after "index.html". Each file type must be separated by a space, and then save it.
5. Restart the Apache program, find the "Apache httpd Server" component in "Programs" in the start menu, and then select "Restart" in "Control Apache Server" under it to re-run the Apache HTTP service.
6. Try entering "http://localhost" or "http://127.0.0.1" in your browser. Ha, can I see your website? Hey, I found that English can be displayed, but Chinese is garbled. When I set View-->Encoding on the IE toolbar to Simplified Chinese, Chinese can be displayed normally, but when I click on the link, other pages are still garbled. Turn off IE and restart IE. I found that It’s also garbled, what should I do?
2. Solution to garbled characters in Apache 2.0.47
The reason is very simple. Since Apache's default encoding is Western European encoding, you only need to find "AddDefaultCharset ISO-8859-1" in "httpd.conf" and modify it to "AddDefaultCharset GB2312". Save and then restart Apache and try again. Maybe Some friends have solved it, but there are still many friends whose websites are still garbled, including mine. What is the reason? There are also introductions on the Internet to change it to "AddDefaultCharset off", which may not necessarily work on your website. It works, but the real problem is that it is caused by the web page production software. If you are using Macromedia's Dreamweaver series software to create it, because its encoding is "gb2312", garbled characters will appear, so you only need to Find "" in the code of the web page, change "gb2312" to "GB2312" and then save the web page and try again, it works!