Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770
Форумы портала PHP.SU :: Версия для печати :: Почему не работает php на домене с www
Форумы портала PHP.SU » Серверное администрирование » Apache и другие веб-серверы » Почему не работает php на домене с www

Страниц (1): [1]
 

1. grafillo - 17 Декабря, 2014 - 23:44:42 - перейти к сообщению
Есть домен если я пишу имя домена без www тогда всё работает если пишу имя домена с www тогда всё грузится но php не работает, в чём может быть проблема?
2. RickMan - 18 Декабря, 2014 - 00:04:17 - перейти к сообщению
Апач настроен правильно? Указан и ServerName (с www) и ServerAlias (без www)?
3. grafillo - 18 Декабря, 2014 - 01:01:47 - перейти к сообщению
RickMan пишет:
Апач настроен правильно? Указан и ServerName (с www) и ServerAlias (без www)?

а как правильно настроить?
ну с ввв грузится только почемуто пхп скрипты не работают((
4. Panoptik - 18 Декабря, 2014 - 01:05:13 - перейти к сообщению
показывайте конфиг виртуал хоста. а то угадывать тут не умеют
5. grafillo - 18 Декабря, 2014 - 01:11:25 - перейти к сообщению
Panoptik пишет:
показывайте конфиг виртуал хоста. а то угадывать тут не умеют

а где он лежит?
6. Panoptik - 18 Декабря, 2014 - 01:14:23 - перейти к сообщению
RTFM
7. grafillo - 18 Декабря, 2014 - 01:24:03 - перейти к сообщению
кароч я понял, фишка в том что я прописал имена файлов без ввв, если прописываю пути к файлам с ввв тогда не рабоатет без ввв и наоборот х)
как это наладить то?
8. RickMan - 18 Декабря, 2014 - 10:31:24 - перейти к сообщению
Вам уже сказали, что надо показать конфиги виртуал хоста. Если не знаете где это искать то just google.
9. grafillo - 18 Декабря, 2014 - 12:06:14 - перейти к сообщению
у меня нет конфигов виртуал хоста, у меня сайт лежит в корневой папке www, я так понимаю надо настроить htaccess редирект с www на без www
(Добавление)
я добавил в папку www файл htaccess вот такой
CODE (htmlphp):
скопировать код в буфер обмена
  1.  
  2. RewriteEngine On
  3. RewriteCond %{HTTP_HOST} ^www.mysite.ru$ [NC]
  4. RewriteRule ^(.*)$ http://mysite.ru/$1 [R=301,L]
  5.  

но ничего не работает
10. RickMan - 18 Декабря, 2014 - 12:37:32 - перейти к сообщению
У вас не может не быть конфигов apache и при этом чтобы сайт отзывался.
http://www[dot]apache[dot]ru/docs/fishki[dot][dot][dot]ml#AllowOverride - так же почитайте про это.
11. grafillo - 18 Декабря, 2014 - 12:57:14 - перейти к сообщению
нашёл файл etc/apache2/conf.d/аpache2 doc
CODE (htmlphp):
скопировать код в буфер обмена
  1.  
  2.  
  3. Alias /manual /usr/share/doc/apache2-doc/manual/
  4.  
  5. <Directory "/usr/share/doc/apache2-doc/manual/">
  6.     Options Indexes FollowSymlinks
  7.     AllowOverride All
  8.     Order allow,deny
  9.     Allow from all
  10.     AddDefaultCharset off
  11. </Directory>
  12.  
  13.  
  14.  

тут нашёл AllowOverride заменил его на all

ещё есть файл etc/apache2/apache2.conf но тут нету строчки AllowOverride
CODE (htmlphp):
скопировать код в буфер обмена
  1.  
  2. #
  3. # Based upon the NCSA server configuration files originally by Rob McCool.
  4. #
  5. # This is the main Apache server configuration file.  It contains the
  6. # configuration directives that give the server its instructions.
  7. # See http://httpd.apache.org/docs/2.2/ for detailed information about
  8. # the directives.
  9. #
  10. # Do NOT simply read the instructions in here without understanding
  11. # what they do.  They're here only as hints or reminders.  If you are unsure
  12. # consult the online docs. You have been warned.  
  13. #
  14. # The configuration directives are grouped into three basic sections:
  15. #  1. Directives that control the operation of the Apache server process as a
  16. #     whole (the 'global environment').
  17. #  2. Directives that define the parameters of the 'main' or 'default' server,
  18. #     which responds to requests that aren't handled by a virtual host.
  19. #     These directives also provide default values for the settings
  20. #     of all virtual hosts.
  21. #  3. Settings for virtual hosts, which allow Web requests to be sent to
  22. #     different IP addresses or hostnames and have them handled by the
  23. #     same Apache server process.
  24. #
  25. # Configuration and logfile names: If the filenames you specify for many
  26. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  27. # server will use that explicit path.  If the filenames do *not* begin
  28. # with "/", the value of ServerRoot is prepended -- so "foo.log"
  29. # with ServerRoot set to "/etc/apache2" will be interpreted by the
  30. # server as "/etc/apache2/foo.log".
  31. #
  32.  
  33. ### Section 1: Global Environment
  34. #
  35. # The directives in this section affect the overall operation of Apache,
  36. # such as the number of concurrent requests it can handle or where it
  37. # can find its configuration files.
  38. #
  39.  
  40. #
  41. # ServerRoot: The top of the directory tree under which the server's
  42. # configuration, error, and log files are kept.
  43. #
  44. # NOTE!  If you intend to place this on an NFS (or otherwise network)
  45. # mounted filesystem then please read the LockFile documentation (available
  46. # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
  47. # you will save yourself a lot of trouble.
  48. #
  49. # Do NOT add a slash at the end of the directory path.
  50. #
  51. #ServerRoot "/etc/apache2"
  52.  
  53. #
  54. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  55. #
  56. LockFile ${APACHE_LOCK_DIR}/accept.lock
  57.  
  58. #
  59. # PidFile: The file in which the server should record its process
  60. # identification number when it starts.
  61. # This needs to be set in /etc/apache2/envvars
  62. #
  63. PidFile ${APACHE_PID_FILE}
  64.  
  65. #
  66. # Timeout: The number of seconds before receives and sends time out.
  67. #
  68. Timeout 300
  69.  
  70. #
  71. # KeepAlive: Whether or not to allow persistent connections (more than
  72. # one request per connection). Set to "Off" to deactivate.
  73. #
  74. KeepAlive On
  75.  
  76. #
  77. # MaxKeepAliveRequests: The maximum number of requests to allow
  78. # during a persistent connection. Set to 0 to allow an unlimited amount.
  79. # We recommend you leave this number high, for maximum performance.
  80. #
  81. MaxKeepAliveRequests 100
  82.  
  83. #
  84. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  85. # same client on the same connection.
  86. #
  87. KeepAliveTimeout 5
  88.  
  89. ##
  90. ## Server-Pool Size Regulation (MPM specific)
  91. ##
  92.  
  93. # prefork MPM
  94. # StartServers: number of server processes to start
  95. # MinSpareServers: minimum number of server processes which are kept spare
  96. # MaxSpareServers: maximum number of server processes which are kept spare
  97. # MaxClients: maximum number of server processes allowed to start
  98. # MaxRequestsPerChild: maximum number of requests a server process serves
  99. <IfModule mpm_prefork_module>
  100. StartServers       1
  101. MinSpareServers    1
  102. MaxSpareServers    5
  103. MaxClients        10
  104.     MaxRequestsPerChild   0
  105. </IfModule>
  106.  
  107. # worker MPM
  108. # StartServers: initial number of server processes to start
  109. # MinSpareThreads: minimum number of worker threads which are kept spare
  110. # MaxSpareThreads: maximum number of worker threads which are kept spare
  111. # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
  112. #              graceful restart. ThreadLimit can only be changed by stopping
  113. #              and starting Apache.
  114. # ThreadsPerChild: constant number of worker threads in each server process
  115. # MaxClients: maximum number of simultaneous client connections
  116. # MaxRequestsPerChild: maximum number of requests a server process serves
  117. <IfModule mpm_worker_module>
  118. StartServers       1
  119. MinSpareThreads    1
  120. MaxSpareThreads    4
  121.     ThreadLimit          64
  122.     ThreadsPerChild      25
  123. MaxClients        10
  124.     MaxRequestsPerChild   0
  125. </IfModule>
  126.  
  127. # event MPM
  128. # StartServers: initial number of server processes to start
  129. # MinSpareThreads: minimum number of worker threads which are kept spare
  130. # MaxSpareThreads: maximum number of worker threads which are kept spare
  131. # ThreadsPerChild: constant number of worker threads in each server process
  132. # MaxClients: maximum number of simultaneous client connections
  133. # MaxRequestsPerChild: maximum number of requests a server process serves
  134. <IfModule mpm_event_module>
  135. StartServers       1
  136. MinSpareThreads    1
  137. MaxSpareThreads    4
  138.     ThreadLimit          64
  139.     ThreadsPerChild      25
  140. MaxClients        10
  141.     MaxRequestsPerChild   0
  142. </IfModule>
  143.  
  144. # These need to be set in /etc/apache2/envvars
  145. User ${APACHE_RUN_USER}
  146. Group ${APACHE_RUN_GROUP}
  147.  
  148. #
  149. # AccessFileName: The name of the file to look for in each directory
  150. # for additional configuration directives.  See also the AllowOverride
  151. # directive.
  152. #
  153.  
  154. AccessFileName .htaccess
  155.  
  156. #
  157. # The following lines prevent .htaccess and .htpasswd files from being
  158. # viewed by Web clients.
  159. #
  160. <Files ~ "^\.ht">
  161.     Order allow,deny
  162.     Deny from all
  163.     Satisfy all
  164. </Files>
  165.  
  166. #
  167. # DefaultType is the default MIME type the server will use for a document
  168. # if it cannot otherwise determine one, such as from filename extensions.
  169. # If your server contains mostly text or HTML documents, "text/plain" is
  170. # a good value.  If most of your content is binary, such as applications
  171. # or images, you may want to use "application/octet-stream" instead to
  172. # keep browsers from trying to display binary files as though they are
  173. # text.
  174. #
  175. # It is also possible to omit any default MIME type and let the
  176. # client's browser guess an appropriate action instead. Typically the
  177. # browser will decide based on the file's extension then. In cases
  178. # where no good assumption can be made, letting the default MIME type
  179. # unset is suggested  instead of forcing the browser to accept
  180. # incorrect  metadata.
  181. #
  182. DefaultType None
  183.  
  184.  
  185. #
  186. # HostnameLookups: Log the names of clients or just their IP addresses
  187. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  188. # The default is off because it'd be overall better for the net if people
  189. # had to knowingly turn this feature on, since enabling it means that
  190. # each client request will result in AT LEAST one lookup request to the
  191. # nameserver.
  192. #
  193. HostnameLookups Off
  194.  
  195. # ErrorLog: The location of the error log file.
  196. # If you do not specify an ErrorLog directive within a <VirtualHost>
  197. # container, error messages relating to that virtual host will be
  198. # logged here.  If you *do* define an error logfile for a <VirtualHost>
  199. # container, that host's errors will be logged there and not here.
  200. #
  201. ErrorLog ${APACHE_LOG_DIR}/error.log
  202.  
  203. #
  204. # LogLevel: Control the number of messages logged to the error_log.
  205. # Possible values include: debug, info, notice, warn, error, crit,
  206. # alert, emerg.
  207. #
  208. LogLevel warn
  209.  
  210. # Include module configuration:
  211. Include mods-enabled/*.load
  212. Include mods-enabled/*.conf
  213.  
  214. # Include all the user configurations:
  215. Include httpd.conf
  216.  
  217. # Include ports listing
  218. Include ports.conf
  219.  
  220. #
  221. # The following directives define some format nicknames for use with
  222. # a CustomLog directive (see below).
  223. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  224. #
  225. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  226. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  227. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  228. LogFormat "%{Referer}i -> %U" referer
  229. LogFormat "%{User-agent}i" agent
  230.  
  231. # Include of directories ignores editors' and dpkg's backup files,
  232. # see README.Debian for details.
  233.  
  234. # Include generic snippets of statements
  235. Include conf.d/
  236.  
  237. # Include the virtual host configurations:
  238. Include sites-enabled/
  239.  
  240.  

 

Powered by ExBB FM 1.0 RC1