Former secretary:Build local YumThe source uses static resource server technology

Services are up and resources can be accessed, but there are 3 unfriendly problems:

  • The file name or path with Chinese characters is garbled
  • Browser support formats are opened directly
  • Long file names are not displayed completely

The resource list is as followsThe visit page on Google Chrome is as followsAfter a period of searching and trying to gradually solve the previous problems:

  1. Garbled code problem:

Edit the HTTPD configuration file httpd.conf to add (or change) the default encoding type of the page to UTF-8

vi /etc/httpd/conf/httpd.conf

. IndexOptions Charset=UTF-8 ...... ` ` `Copy the code

Save, restart the service, Chinese garble problem solved

2. Long file name and incomplete display:

Edit the HTTPD configuration file autoindex.conf(line:15) and add (or modify) the index name to *****.

vi /etc/httpd/conf.d/autoindex.conf

. # # IndexOptions: Controls the appearance of server-generated directory # listings. IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* ...... ` ` `Copy the code

Save, restart the service, and the problem of incomplete name display is solved

3. Click the link to open directly in the browser

Edit the local configuration file **/etc/mime.types**(line:157) to configure the extension of the file expected to be downloaded directlyvi /etc/mime.types

. application/octet-stream bin lha lzh exe class so dll img iso ppt pptx doc docx xls xlsx pdf ...... ` ` `Copy the code

Save, restart the service, specify the file format and click the link to download it (Note: Some files, such as PDF files, have separate annotations in the configuration file. If you want to support direct download of these files, you can try to note out the configuration of the corresponding extension and keep only the application/ OCtet-stream convention. When testing again, it is recommended to clean the browser cache.)

The End