##修改配置文件httpd.conf=中以下内容 [root@server ~]# vim /etc/httpd/conf/httpd.conf
Listen 82 #监听端口号 82 默认是80 DocumentRoot "/var/www/html/file" <Directory "/var/www/html"> # # 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" # 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 IndexOptions Charset=UTF-8 ##添加这一行 避免中文乱码 # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None
# # Controls who can get stuff from this server. # Require all granted </Directory>