VPS侦探论坛

 找回密码
 注册
查看: 94|回复: 9

[Apache] 请问LAMP+DiscuzX3.4 首页变下载

[复制链接]
发表于 2021-12-22 10:52:01 | 显示全部楼层 |阅读模式



一键安装的lamp环境,apache2.4.48+php7.4.21。安装discuz3.4,都一切正常。但是访问的时候直接就下载forum.php了,手动打开http://域名/index.php是正常可以的.请问有没有大佬知道怎么解决的?

美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2021-12-22 13:08:12 | 显示全部楼层


贴配置文件看一下
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2021-12-22 14:15:00 | 显示全部楼层



这个是PHP和APACHE配置文件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2021-12-22 14:24:41 | 显示全部楼层




  1. <VirtualHost *:80>
  2. ServerAdmin webmaster@example.com
  3. php_admin_value open_basedir "/data/wwwroot/bbs/:/tmp/:/var/tmp/:/proc/"
  4. DocumentRoot "/data/wwwroot/bbs/"
  5. ServerName 172.16.20.70
  6. ErrorLog "/data/logs/172.16.20.70-error_log"
  7. CustomLog "/data/logs/172.16.20.70-access_log" combined
  8. <Directory /data/wwwroot/bbs/">
  9.     SetOutputFilter DEFLATE
  10.     Options FollowSymLinks
  11.     AllowOverride All
  12.     Order allow,deny
  13.     Allow from all
  14.     DirectoryIndex index.html index.php
  15. </Directory>
  16. </VirtualHost>
复制代码




补充内容 (2021-12-22 14:25):
这是vhost的配置
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2021-12-22 14:44:03 | 显示全部楼层

  1. <blockquote><blockquote>ServerRoot "/usr/local/apache"
复制代码

美国VPS、VPN、域名代购:http://shop63846532.taobao.com/

 楼主| 发表于 2021-12-22 14:45:08 | 显示全部楼层

  1. ServerRoot "/usr/local/apache"
  2. Listen 80

  3. LoadModule authn_file_module modules/mod_authn_file.so
  4. #LoadModule authn_dbm_module modules/mod_authn_dbm.so
  5. #LoadModule authn_anon_module modules/mod_authn_anon.so
  6. #LoadModule authn_dbd_module modules/mod_authn_dbd.so
  7. #LoadModule authn_socache_module modules/mod_authn_socache.so
  8. LoadModule authn_core_module modules/mod_authn_core.so
  9. LoadModule authz_host_module modules/mod_authz_host.so
  10. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  11. LoadModule authz_user_module modules/mod_authz_user.so
  12. #LoadModule authz_dbm_module modules/mod_authz_dbm.so
  13. #LoadModule authz_owner_module modules/mod_authz_owner.so
  14. #LoadModule authz_dbd_module modules/mod_authz_dbd.so
  15. LoadModule authz_core_module modules/mod_authz_core.so
  16. LoadModule access_compat_module modules/mod_access_compat.so
  17. LoadModule auth_basic_module modules/mod_auth_basic.so
  18. #LoadModule auth_form_module modules/mod_auth_form.so
  19. #LoadModule auth_digest_module modules/mod_auth_digest.so
  20. #LoadModule allowmethods_module modules/mod_allowmethods.so
  21. #LoadModule file_cache_module modules/mod_file_cache.so
  22. #LoadModule cache_module modules/mod_cache.so
  23. #LoadModule cache_disk_module modules/mod_cache_disk.so
  24. #LoadModule cache_socache_module modules/mod_cache_socache.so
  25. LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
  26. #LoadModule socache_dbm_module modules/mod_socache_dbm.so
  27. #LoadModule socache_memcache_module modules/mod_socache_memcache.so
  28. #LoadModule macro_module modules/mod_macro.so
  29. #LoadModule dbd_module modules/mod_dbd.so
  30. #LoadModule dumpio_module modules/mod_dumpio.so
  31. #LoadModule buffer_module modules/mod_buffer.so
  32. #LoadModule ratelimit_module modules/mod_ratelimit.so
  33. LoadModule reqtimeout_module modules/mod_reqtimeout.so
  34. #LoadModule ext_filter_module modules/mod_ext_filter.so
  35. #LoadModule request_module modules/mod_request.so
  36. #LoadModule include_module modules/mod_include.so
  37. LoadModule filter_module modules/mod_filter.so
  38. #LoadModule substitute_module modules/mod_substitute.so
  39. #LoadModule sed_module modules/mod_sed.so
  40. LoadModule deflate_module modules/mod_deflate.so
  41. LoadModule mime_module modules/mod_mime.so
  42. LoadModule log_config_module modules/mod_log_config.so
  43. #LoadModule log_debug_module modules/mod_log_debug.so
  44. #LoadModule logio_module modules/mod_logio.so
  45. LoadModule env_module modules/mod_env.so
  46. #LoadModule mime_magic_module modules/mod_mime_magic.so
  47. LoadModule expires_module modules/mod_expires.so
  48. LoadModule headers_module modules/mod_headers.so
  49. #LoadModule unique_id_module modules/mod_unique_id.so
  50. LoadModule setenvif_module modules/mod_setenvif.so
  51. LoadModule version_module modules/mod_version.so
  52. LoadModule remoteip_module modules/mod_remoteip.so
  53. LoadModule proxy_module modules/mod_proxy.so
  54. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  55. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  56. LoadModule proxy_http_module modules/mod_proxy_http.so
  57. LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
  58. LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
  59. LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
  60. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  61. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  62. LoadModule proxy_express_module modules/mod_proxy_express.so
  63. #LoadModule session_module modules/mod_session.so
  64. #LoadModule session_cookie_module modules/mod_session_cookie.so
  65. #LoadModule session_dbd_module modules/mod_session_dbd.so
  66. LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
  67. LoadModule ssl_module modules/mod_ssl.so
  68. LoadModule http2_module modules/mod_http2.so
  69. LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
  70. LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
  71. LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
  72. #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
  73. #LoadModule mpm_worker_module modules/mod_mpm_worker.so
  74. LoadModule mpm_event_module modules/mod_mpm_event.so
  75. #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
  76. LoadModule unixd_module modules/mod_unixd.so
  77. #LoadModule dav_module modules/mod_dav.so
  78. LoadModule status_module modules/mod_status.so
  79. LoadModule autoindex_module modules/mod_autoindex.so
  80. #LoadModule info_module modules/mod_info.so
  81. #LoadModule cgid_module modules/mod_cgid.so
  82. #LoadModule dav_fs_module modules/mod_dav_fs.so
  83. #LoadModule vhost_alias_module modules/mod_vhost_alias.so
  84. #LoadModule negotiation_module modules/mod_negotiation.so
  85. LoadModule dir_module modules/mod_dir.so
  86. #LoadModule actions_module modules/mod_actions.so
  87. #LoadModule speling_module modules/mod_speling.so
  88. #LoadModule userdir_module modules/mod_userdir.so
  89. LoadModule alias_module modules/mod_alias.so
  90. LoadModule rewrite_module modules/mod_rewrite.so
  91. LoadModule php7_module        modules/libphp7.so
  92. <IfModule unixd_module>
  93. User www
  94. Group www
  95. </IfModule>
  96. ServerAdmin you@example.com
  97. ServerName 172.16.20.70:80
  98. <Directory />
  99.      Options None
  100.      AllowOverride None
  101.      Order allow,deny
  102.      Allow from all
  103. </Directory>
  104. DocumentRoot "/data/wwwroot/bbs"
  105. <Directory "/data/wwwroot/bbs">
  106.    Options None
  107.     AllowOverride None
  108.     Require all granted
  109. </Directory>
  110. <IfModule dir_module>
  111.     DirectoryIndex index.php index.html index.htm
  112. </IfModule>
  113. <Files ".ht*">
  114.     Require all denied
  115. </Files>
  116. ErrorLog "/data/logs/error_log"
  117. LogLevel crit
  118. <IfModule log_config_module>   
  119.     LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
  120.     LogFormat "%h %l %u %t "%r" %>s %b" common
  121.     <IfModule logio_module>
  122.       # You need to enable mod_logio.c to use %I and %O
  123.       LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
  124.     </IfModule>
  125.    CustomLog "logs/access_log" common
  126. </IfModule>
  127. <IfModule headers_module>
  128.     RequestHeader unset Proxy early
  129. </IfModule>
  130. <IfModule alias_module>
  131.         ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
  132. </IfModule>
  133. <Directory "/usr/local/apache/cgi-bin">
  134.     AllowOverride All
  135.     Options None
  136.     Require all granted
  137. </Directory>
  138. <IfModule mime_module>
  139.     TypesConfig conf/mime.types
  140.     AddType application/x-compress .Z
  141.     AddType application/x-gzip .gz .tgz
  142.     AddType application/x-httpd-php .php
  143.     AddType application/x-httpd-php-source .phps
  144. </IfModule>
  145. Include conf/extra/httpd-mpm.conf
  146. # Various default settings
  147. Include conf/extra/httpd-default.conf
  148. # Configure mod_proxy_html to understand HTML4/XHTML1
  149. <IfModule proxy_html_module>
  150. Include conf/extra/proxy-html.conf
  151. </IfModule>
  152. <IfModule ssl_module>
  153.     SSLRandomSeed startup builtin
  154.     SSLRandomSeed connect builtin
  155. </IfModule>
  156. <IfModule http2_module>
  157.     ProtocolsHonorOrder On
  158.     Protocols h2 h2c http/1.1
  159. </IfModule>
  160. IncludeOptional conf/vhost/*.conf
复制代码


 楼主| 发表于 2021-12-22 14:57:38 | 显示全部楼层

  1. [PHP]
  2. engine = On
  3. short_open_tag = On
  4. precision = 14
  5. output_buffering = 4096
  6. zlib.output_compression = Off
  7. implicit_flush = Off
  8. unserialize_callback_func =
  9. serialize_precision = -1
  10. disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
  11. disable_classes =
  12. zend.enable_gc = On
  13. zend.exception_ignore_args = On
  14. expose_php = On
  15. max_execution_time = 300
  16. max_input_time = 60
  17. memory_limit = 128M
  18. error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
  19. display_errors = Off
  20. display_startup_errors = Off
  21. log_errors = On
  22. log_errors_max_len = 1024
  23. ignore_repeated_errors = Off
  24. ignore_repeated_source = Off
  25. report_memleaks = On
  26. variables_order = "GPCS"
  27. request_order = "GP"
  28. register_argc_argv = Off
  29. auto_globals_jit = On
  30. post_max_size = 50M
  31. auto_prepend_file =
  32. auto_append_file =
  33. default_mimetype = "text/html"
  34. default_charset = "UTF-8"
  35. doc_root =
  36. user_dir =
  37. enable_dl = Off
  38. cgi.fix_pathinfo=0
  39. file_uploads = On
  40. upload_max_filesize = 50M
  41. max_file_uploads = 20
  42. allow_url_fopen = On
  43. allow_url_include = Off
  44. default_socket_timeout = 60

  45. [CLI Server]
  46. cli_server.color = On

  47. [Date]
  48. date.timezone = PRC

  49. [filter]

  50. [iconv]

  51. [imap]

  52. [intl]

  53. [sqlite3]

  54. [Pcre]

  55. [Pdo]

  56. [Pdo_mysql]
  57. pdo_mysql.default_socket=

  58. [Phar]

  59. [mail function]
  60. SMTP = localhost
  61. smtp_port = 25
  62. mail.add_x_header = Off

  63. [ODBC]
  64. odbc.allow_persistent = On
  65. odbc.check_persistent = On
  66. odbc.max_persistent = -1
  67. odbc.max_links = -1
  68. odbc.defaultlrl = 4096
  69. odbc.defaultbinmode = 1

  70. [MySQLi]
  71. mysqli.max_persistent = -1
  72. mysqli.allow_persistent = On
  73. mysqli.max_links = -1
  74. mysqli.default_port = 3306
  75. mysqli.default_socket =
  76. mysqli.default_host =
  77. mysqli.default_user =
  78. mysqli.default_pw =
  79. mysqli.reconnect = Off

  80. [mysqlnd]
  81. mysqlnd.collect_statistics = On
  82. mysqlnd.collect_memory_statistics = Off
  83. [OCI8]

  84. [PostgreSQL]
  85. pgsql.allow_persistent = On
  86. pgsql.auto_reset_persistent = Off
  87. pgsql.max_persistent = -1
  88. pgsql.max_links = -1
  89. pgsql.ignore_notice = 0
  90. pgsql.log_notice = 0

  91. [bcmath]
  92. bcmath.scale = 0

  93. [browscap]

  94. [Session]
  95. session.save_handler = files
  96. session.use_strict_mode = 0
  97. session.use_cookies = 1
  98. session.use_only_cookies = 1
  99. session.name = PHPSESSID
  100. session.auto_start = 0
  101. session.cookie_lifetime = 0
  102. session.cookie_path = /
  103. session.cookie_domain =
  104. session.cookie_httponly =
  105. session.cookie_samesite =
  106. session.serialize_handler = php
  107. session.gc_probability = 1
  108. session.gc_divisor = 1000
  109. session.gc_maxlifetime = 1440
  110. session.referer_check =
  111. session.cache_limiter = nocache
  112. session.cache_expire = 180
  113. session.use_trans_sid = 0
  114. session.sid_length = 26
  115. session.trans_sid_tags = "a=href,area=href,frame=src,form="
  116. session.sid_bits_per_character = 5

  117. [Assertion]
  118. zend.assertions = -1
  119. [COM]

  120. [mbstring]

  121. [gd]

  122. [exif]

  123. [Tidy]
  124. tidy.clean_output = Off

  125. [soap]
  126. soap.wsdl_cache_enabled=1
  127. soap.wsdl_cache_dir="/tmp"
  128. soap.wsdl_cache_ttl=86400
  129. soap.wsdl_cache_limit = 5

  130. [sysvshm]

  131. [ldap]
  132. ldap.max_links = -1

  133. [dba]

  134. [opcache]

  135. [curl]

  136. [openssl]

  137. [ffi]
复制代码


美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2021-12-22 19:10:47 | 显示全部楼层



你如果在IP上建站的话 httpd.conf 不要改,只改 httpd-vhosts.conf
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2021-12-23 09:47:47 | 显示全部楼层



licess 发表于 2021-12-22 19:10
你如果在IP上建站的话 httpd.conf 不要改,只改 httpd-vhosts.conf

因为访问首页,会下载forum.php才改的http.conf配置,然后发现改了以后还是不行.同时修改的时候也做了备份的,还原初始http.conf问题还是一样.
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2021-12-23 19:47:09 | 显示全部楼层



流浪街头 发表于 2021-12-23 09:47
因为访问首页,会下载forum.php才改的http.conf配置,然后发现改了以后还是不行.同时修改的时候也做了备 ...

全部恢复安装后的原始配置文件,然后 lnmp vhost add 添加,域名那边填写你的IP
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2022-1-29 18:35 , Processed in 0.087372 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表