mod_rewrite БАГ

Простые/общие вопросы по UNIX системам. Спросите здесь, если вы новичок

Модераторы: vadim64, terminus

Правила форума
Убедительная просьба юзать теги [cоde] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Гость
проходил мимо

mod_rewrite БАГ

Непрочитанное сообщение Гость » 2011-07-10 13:48:57

Подскажите как добавить в рабочий apache22 модуль mod_rewrite....собирал с ним но его нету почемуто в модулях...и собствено в логах ошибки сыпятся что он не врублен....

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Гость
проходил мимо

Re: mod_rewrite БАГ

Непрочитанное сообщение Гость » 2011-07-10 13:56:06

такого плана

Код: Выделить всё

.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Аватара пользователя
vadim64
майор
Сообщения: 2101
Зарегистрирован: 2009-09-17 15:15:26
Откуда: Засратовец

Re: mod_rewrite БАГ

Непрочитанное сообщение vadim64 » 2011-07-10 19:35:06

Код: Выделить всё

cat -n /usr/local/etc/apache22/httpd.conf
Люди не делятся на национальности, партии, фракции и религии. Люди делятся на умных и дураков, а вот дураки делятся на национальности, партии, фракции и религии.


Гость
проходил мимо

Re: mod_rewrite БАГ

Непрочитанное сообщение Гость » 2011-07-11 0:58:23

Код: Выделить всё

     1	#
     2	# This is the main Apache HTTP server configuration file.  It contains the
     3	# configuration directives that give the server its instructions.
     4	# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
     5	# In particular, see 
     6	# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
     7	# for a discussion of each configuration directive.
     8	#
     9	# Do NOT simply read the instructions in here without understanding
    10	# what they do.  They're here only as hints or reminders.  If you are unsure
    11	# consult the online docs. You have been warned.  
    12	#
    13	# Configuration and logfile names: If the filenames you specify for many
    14	# of the server's control files begin with "/" (or "drive:/" for Win32), the
    15	# server will use that explicit path.  If the filenames do *not* begin
    16	# with "/", the value of ServerRoot is prepended -- so "/var/log/foo_log"
    17	# with ServerRoot set to "/usr/local" will be interpreted by the
    18	# server as "/usr/local//var/log/foo_log".
    19	
    20	#
    21	# ServerRoot: The top of the directory tree under which the server's
    22	# configuration, error, and log files are kept.
    23	#
    24	# Do not add a slash at the end of the directory path.  If you point
    25	# ServerRoot at a non-local disk, be sure to point the LockFile directive
    26	# at a local disk.  If you wish to share the same ServerRoot for multiple
    27	# httpd daemons, you will need to change at least LockFile and PidFile.
    28	#
    29	ServerRoot "/usr/local"
    30	
    31	#
    32	# Listen: Allows you to bind Apache to specific IP addresses and/or
    33	# ports, instead of the default. See also the <VirtualHost>
    34	# directive.
    35	#
    36	# Change this to Listen on specific IP addresses as shown below to 
    37	# prevent Apache from glomming onto all bound IP addresses.
    38	#
    39	Listen 127.0.0.1:8080
    40	#Listen 80
    41	
    42	#
    43	# Dynamic Shared Object (DSO) Support
    44	#
    45	# To be able to use the functionality of a module which was built as a DSO you
    46	# have to place corresponding `LoadModule' lines at this location so the
    47	# directives contained in it are actually available _before_ they are used.
    48	# Statically compiled modules (those listed by `httpd -l') do not need
    49	# to be loaded here.
    50	#
    51	# Example:
    52	# LoadModule foo_module modules/mod_foo.so
    53	#
    54	LoadModule authz_host_module libexec/apache22/mod_authz_host.so
    55	LoadModule auth_basic_module libexec/apache22/mod_auth_basic.so
    56	LoadModule file_cache_module libexec/apache22/mod_file_cache.so
    57	LoadModule cache_module libexec/apache22/mod_cache.so
    58	LoadModule disk_cache_module libexec/apache22/mod_disk_cache.so
    59	LoadModule log_config_module libexec/apache22/mod_log_config.so
    60	LoadModule mime_module libexec/apache22/mod_mime.so
    61	LoadModule dir_module libexec/apache22/mod_dir.so
    62	LoadModule actions_module libexec/apache22/mod_actions.so
    63	LoadModule php5_module        libexec/apache22/libphp5.so
    64	LoadModule rpaf_module        libexec/apache22/mod_rpaf.so
    65	#LoadModule unique_id_module libexec/apache22/mod_unique_id.so
    66	#LoadModule security2_module libexec/apache22/mod_security2.so
    67	<IfModule !mpm_netware_module>
    68	<IfModule !mpm_winnt_module>
    69	#
    70	# If you wish httpd to run as a different user or group, you must run
    71	# httpd as root initially and it will switch.  
    72	#
    73	# User/Group: The name (or #number) of the user/group to run httpd as.
    74	# It is usually good practice to create a dedicated user and group for
    75	# running httpd, as with most system services.
    76	#
    77	User www
    78	Group www
    79	
    80	</IfModule>
    81	</IfModule>
    82	
    83	# 'Main' server configuration
    84	#
    85	# The directives in this section set up the values used by the 'main'
    86	# server, which responds to any requests that aren't handled by a
    87	# <VirtualHost> definition.  These values also provide defaults for
    88	# any <VirtualHost> containers you may define later in the file.
    89	#
    90	# All of these directives may appear inside <VirtualHost> containers,
    91	# in which case these default settings will be overridden for the
    92	# virtual host being defined.
    93	#
    94	
    95	#
    96	# ServerAdmin: Your address, where problems with the server should be
    97	# e-mailed.  This address appears on some server-generated pages, such
    98	# as error documents.  e.g. admin@your-domain.com
    99	#
   100	ServerAdmin you@example.com
   101	
   102	#
   103	# ServerName gives the name and port that the server uses to identify itself.
   104	# This can often be determined automatically, but we recommend you specify
   105	# it explicitly to prevent problems during startup.
   106	#
   107	# If your host doesn't have a registered DNS name, enter its IP address here.
   108	#
   109	#ServerName www.example.com:80
   110	ServerName 172.16.10.90
   111	
   112	
   113	#
   114	# DocumentRoot: The directory out of which you will serve your
   115	# documents. By default, all requests are taken from this directory, but
   116	# symbolic links and aliases may be used to point to other locations.
   117	#
   118	DocumentRoot "/files/www"
   119	
   120	#
   121	# Each directory to which Apache has access can be configured with respect
   122	# to which services and features are allowed and/or disabled in that
   123	# directory (and its subdirectories). 
   124	#
   125	# First, we configure the "default" to be a very restrictive set of 
   126	# features.  
   127	#
   128	<Directory />
   129	    AllowOverride None
   130	    Order deny,allow
   131	    Deny from all
   132	</Directory>
   133	
   134	#
   135	# Note that from this point forward you must specifically allow
   136	# particular features to be enabled - so if something's not working as
   137	# you might expect, make sure that you have specifically enabled it
   138	# below.
   139	#
   140	
   141	#
   142	# This should be changed to whatever you set DocumentRoot to.
   143	#
   144	<Directory "/files/www/">
   145	php_admin_value open_basedir /files/www
   146	    #
   147	    # Possible values for the Options directive are "None", "All",
   148	    # or any combination of:
   149	    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
   150	    #
   151	    # Note that "MultiViews" must be named *explicitly* --- "Options All"
   152	    # doesn't give it to you.
   153	    #
   154	    # The Options directive is both complicated and important.  Please see
   155	    # http://httpd.apache.org/docs/2.2/mod/core.html#options
   156	    # for more information.
   157	    #
   158	    Options Indexes FollowSymLinks
   159	
   160	    #
   161	    # AllowOverride controls what directives may be placed in .htaccess files.
   162	    # It can be "All", "None", or any combination of the keywords:
   163	    #   Options FileInfo AuthConfig Limit
   164	    #
   165	    AllowOverride All
   166	
   167	    #
   168	    # Controls who can get stuff from this server.
   169	    #
   170	    Order allow,deny
   171	    Allow from all
   172	
   173	</Directory>
   174	
   175	#
   176	# DirectoryIndex: sets the file that Apache will serve if a directory
   177	# is requested.
   178	#
   179	<IfModule dir_module>
   180	    DirectoryIndex index.php index.html
   181	</IfModule>
   182	
   183	#
   184	# The following lines prevent .htaccess and .htpasswd files from being 
   185	# viewed by Web clients. 
   186	#
   187	<FilesMatch "^\.ht">
   188	    Order allow,deny
   189	    Deny from all
   190	    Satisfy All
   191	</FilesMatch>
   192	
   193	#
   194	# ErrorLog: The location of the error log file.
   195	# If you do not specify an ErrorLog directive within a <VirtualHost>
   196	# container, error messages relating to that virtual host will be
   197	# logged here.  If you *do* define an error logfile for a <VirtualHost>
   198	# container, that host's errors will be logged there and not here.
   199	#
   200	ErrorLog "/var/log/httpd-error.log"
   201	
   202	#
   203	# LogLevel: Control the number of messages logged to the error_log.
   204	# Possible values include: debug, info, notice, warn, error, crit,
   205	# alert, emerg.
   206	#
   207	LogLevel warn
   208	
   209	<IfModule log_config_module>
   210	    #
   211	    # The following directives define some format nicknames for use with
   212	    # a CustomLog directive (see below).
   213	    #
   214	    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
   215	    LogFormat "%h %l %u %t \"%r\" %>s %b" common
   216	
   217	    <IfModule logio_module>
   218	      # You need to enable mod_logio.c to use %I and %O
   219	      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
   220	    </IfModule>
   221	
   222	    #
   223	    # The location and format of the access logfile (Common Logfile Format).
   224	    # If you do not define any access logfiles within a <VirtualHost>
   225	    # container, they will be logged here.  Contrariwise, if you *do*
   226	    # define per-<VirtualHost> access logfiles, transactions will be
   227	    # logged therein and *not* in this file.
   228	    #
   229	    #CustomLog "/var/log/httpd-access.log" common
   230	
   231	    #
   232	    # If you prefer a logfile with access, agent, and referer information
   233	    # (Combined Logfile Format) you can use the following directive.
   234	    #
   235	    #######################!!!!!!!!!!!!!!!!!!!!!##############CustomLog "/var/log/httpd-access.log" combined
   236	    CustomLog /dev/null combined
   237	</IfModule>
   238	
   239	<IfModule alias_module>
   240	    #
   241	    # Redirect: Allows you to tell clients about documents that used to 
   242	    # exist in your server's namespace, but do not anymore. The client 
   243	    # will make a new request for the document at its new location.
   244	    # Example:
   245	    # Redirect permanent /foo http://www.example.com/bar
   246	
   247	    #
   248	    # Alias: Maps web paths into filesystem paths and is used to
   249	    # access content that does not live under the DocumentRoot.
   250	    # Example:
   251	    # Alias /webpath /full/filesystem/path
   252	    #
   253	    # If you include a trailing / on /webpath then the server will
   254	    # require it to be present in the URL.  You will also likely
   255	    # need to provide a <Directory> section to allow access to
   256	    # the filesystem path.
   257	
   258	    #
   259	    # ScriptAlias: This controls which directories contain server scripts. 
   260	    # ScriptAliases are essentially the same as Aliases, except that
   261	    # documents in the target directory are treated as applications and
   262	    # run by the server when requested rather than as documents sent to the
   263	    # client.  The same rules about trailing "/" apply to ScriptAlias
   264	    # directives as to Alias.
   265	    #
   266	    ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/"
   267	
   268	</IfModule>
   269	
   270	<IfModule cgid_module>
   271	    #
   272	    # ScriptSock: On threaded servers, designate the path to the UNIX
   273	    # socket used to communicate with the CGI daemon of mod_cgid.
   274	    #
   275	    #Scriptsock /var/run/cgisock
   276	</IfModule>
   277	
   278	#
   279	# "/usr/local/www/apache22/cgi-bin" should be changed to whatever your ScriptAliased
   280	# CGI directory exists, if you have that configured.
   281	#
   282	<Directory "/usr/local/www/apache22/cgi-bin">
   283	    AllowOverride None
   284	    Options None
   285	    Order allow,deny
   286	    Allow from all
   287	</Directory>
   288	
   289	#
   290	# DefaultType: the default MIME type the server will use for a document
   291	# if it cannot otherwise determine one, such as from filename extensions.
   292	# If your server contains mostly text or HTML documents, "text/plain" is
   293	# a good value.  If most of your content is binary, such as applications
   294	# or images, you may want to use "application/octet-stream" instead to
   295	# keep browsers from trying to display binary files as though they are
   296	# text.
   297	#
   298	DefaultType text/plain
   299	
   300	<IfModule mime_module>
   301	    #
   302	    # TypesConfig points to the file containing the list of mappings from
   303	    # filename extension to MIME-type.
   304	    #
   305	    TypesConfig etc/apache22/mime.types
   306	
   307	    #
   308	    # AddType allows you to add to or override the MIME configuration
   309	    # file specified in TypesConfig for specific file types.
   310	    #
   311	    #AddType application/x-gzip .tgz
   312	    #
   313	    # AddEncoding allows you to have certain browsers uncompress
   314	    # information on the fly. Note: Not all browsers support this.
   315	    #
   316	    #AddEncoding x-compress .Z
   317	    #AddEncoding x-gzip .gz .tgz
   318	    #
   319	    # If the AddEncoding directives above are commented-out, then you
   320	    # probably should define those extensions to indicate media types:
   321	    #
   322	    AddType application/x-compress .Z
   323	    AddType application/x-gzip .gz .tgz
   324	
   325	    #
   326	    # AddHandler allows you to map certain file extensions to "handlers":
   327	    # actions unrelated to filetype. These can be either built into the server
   328	    # or added with the Action directive (see below)
   329	    #
   330	    # To use CGI scripts outside of ScriptAliased directories:
   331	    # (You will also need to add "ExecCGI" to the "Options" directive.)
   332	    #
   333	    #AddHandler cgi-script .cgi
   334	
   335	    # For type maps (negotiated resources):
   336	    #AddHandler type-map var
   337	
   338	    #
   339	    # Filters allow you to process content before it is sent to the client.
   340	    #
   341	    # To parse .shtml files for server-side includes (SSI):
   342	    # (You will also need to add "Includes" to the "Options" directive.)
   343	    #
   344	    #AddType text/html .shtml
   345	    #AddOutputFilter INCLUDES .shtml
   346	</IfModule>
   347	
   348	#
   349	# The mod_mime_magic module allows the server to use various hints from the
   350	# contents of the file itself to determine its type.  The MIMEMagicFile
   351	# directive tells the module where the hint definitions are located.
   352	#
   353	#MIMEMagicFile etc/apache22/magic
   354	
   355	#
   356	# Customizable error responses come in three flavors:
   357	# 1) plain text 2) local redirects 3) external redirects
   358	#
   359	# Some examples:
   360	#ErrorDocument 500 "The server made a boo boo."
   361	#ErrorDocument 404 /missing.html
   362	#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
   363	#ErrorDocument 402 http://www.example.com/subscription_info.html
   364	#
   365	
   366	#
   367	# EnableMMAP and EnableSendfile: On systems that support it, 
   368	# memory-mapping or the sendfile syscall is used to deliver
   369	# files.  This usually improves server performance, but must
   370	# be turned off when serving from networked-mounted 
   371	# filesystems or if support for these functions is otherwise
   372	# broken on your system.
   373	#
   374	#EnableMMAP off
   375	#EnableSendfile off
   376	
   377	# Supplemental configuration
   378	#
   379	# The configuration files in the etc/apache22/extra/ directory can be 
   380	# included to add extra features or to modify the default configuration of 
   381	# the server, or you may simply copy their contents here and change as 
   382	# necessary.
   383	
   384	# Server-pool management (MPM specific)
   385	#Include etc/apache22/extra/httpd-mpm.conf
   386	
   387	# Multi-language error messages
   388	#Include etc/apache22/extra/httpd-multilang-errordoc.conf
   389	
   390	# Fancy directory listings
   391	#Include etc/apache22/extra/httpd-autoindex.conf
   392	
   393	# Language settings
   394	#Include etc/apache22/extra/httpd-languages.conf
   395	
   396	# User home directories
   397	#Include etc/apache22/extra/httpd-userdir.conf
   398	
   399	# Real-time info on requests and configuration
   400	#Include etc/apache22/extra/httpd-info.conf
   401	
   402	# Virtual hosts
   403	#Include etc/apache22/extra/httpd-vhosts.conf
   404	
   405	# Local access to the Apache HTTP Server Manual
   406	#Include etc/apache22/extra/httpd-manual.conf
   407	
   408	# Distributed authoring and versioning (WebDAV)
   409	#Include etc/apache22/extra/httpd-dav.conf
   410	
   411	# Various default settings
   412	#Include etc/apache22/extra/httpd-default.conf
   413	
   414	# Secure (SSL/TLS) connections
   415	#Include etc/apache22/extra/httpd-ssl.conf
   416	#
   417	# Note: The following must must be present to support
   418	#       starting without SSL on platforms with no /dev/random equivalent
   419	#       but a statically compiled-in mod_ssl.
   420	#
   421	<IfModule ssl_module>
   422	SSLRandomSeed startup builtin
   423	SSLRandomSeed connect builtin
   424	</IfModule>
   425	
   426	Include etc/apache22/Includes/*.conf
   427	
   428	<IfModule mod_php5.c>
   429	DirectoryIndex index.php index.html
   430	AddType application/x-httpd-php .php
   431	AddType application/x-httpd-php-source .phps
   432	</IfModule>
   433	
   434	# Включаем модуль
   435	RPAFenable On
   436	# Доводит до ума X-Host
   437	RPAFsethostname On
   438	# Адрес фронтенда (nginx)
   439	RPAFproxy_ips 172.16.10.90 127.0.0.1
   440	# Имя отправляемого заголовка
   441	RPAFheader X-Forwarded-For
   442	
   443	StartServers 3
   444	MinSpareServers 3
   445	MaxSpareServers 3
   446	MaxClients 11
   447	ServerLimit 11
   448	#2500!!!!!!!!!!
   449	MaxRequestsPerChild 2500
   450	#KeepAlive On
   451	#MaxKeepAliveRequests 100
   452	#KeepAliveTimeout 15
   453	
   454	#<IfModule mod_php4.c>
   455	# Включаем Safe mode
   456	#php_admin_flag safe_mode on
   457	#php_admin_flag safe_mode_gid on
   458	#php_admin_value open_basedir /files/www
   459	# Папка, выше которой скрипт не может видеть
   460	#php_admin_value safe_mode_exec_dir /files/www
   461	# Temp диры юзера 
   462	#php_admin_value upload_tmp_dir /files/www/tmp
   463	# Не начинать PHP сессию автоматически
   464	#php_admin_flag session.auto_start off
   465	# Где сохранять файлы сессий
   466	#php_admin_value session.save_path /files/www/tmp
   467	#</IfModule>
   468	
   469	##SecRuleEngine On
   470	##SecRequestBodyAccess On
   471	##SecResponseBodyAccess Off
   472	###########################################SecFilterSelective ARG_b2inc "!^$"
   473	# Handling of file uploads
   474	# TODO Choose a folder private to Apache.
   475	# SecUploadDir /opt/apache-frontend/tmp/
   476	##SecUploadKeepFiles Off
   477	# Debug log
   478	##SecDebugLog /var/log/modsec_debug.log
   479	##SecDebugLogLevel 0
   480	# Serial audit log
   481	##SecAuditEngine RelevantOnly
   482	##SecAuditLogRelevantStatus ^5
   483	##SecAuditLogParts ABIFHZ
   484	##SecAuditLogType Serial
   485	##SecAuditLog /var/log/modsec_audit.log
   486	##SecDefaultAction "deny,log,phase:1,status:500"
   487	# Maximum request body size we will
   488	# accept for buffering
   489	##SecRequestBodyLimit 131072
   490	# Store up to 128 KB in memory
   491	##SecRequestBodyInMemoryLimit 131072
   492	# Buffer response bodies of up to
   493	# 512 KB in length
   494	##SecResponseBodyLimit 524288
   495	# Перекрываем dots-bug
   496	##SecRule REQUEST_URI|QUERY_STRING "\.\./"
   497	# Не забываем про XSS
   498	##SecRule REQUEST_URI|QUERY_STRING "<(.|\n)+>"
   499	# SQL injection, куда же без него :)
   500	##SecRule REQUEST_URI|QUERY_STRING "<[[:space:]]*script"
   501	##SecRule REQUEST_URI|QUERY_STRING "delete[[:space:]]+from"
   502	##SecRule REQUEST_URI|QUERY_STRING "insert[[:space:]]+into"
   503	##SecRule REQUEST_URI|QUERY_STRING "select.+from"
в самих модулях смотрел его там нету......+ в портах набирал make config и смотрел там он включен.....

Аватара пользователя
vadim64
майор
Сообщения: 2101
Зарегистрирован: 2009-09-17 15:15:26
Откуда: Засратовец

Re: mod_rewrite БАГ

Непрочитанное сообщение vadim64 » 2011-07-11 5:04:50

попробуйте таки добавить его описание в конфу апача, по аналогии с остальными модулями
Люди не делятся на национальности, партии, фракции и религии. Люди делятся на умных и дураков, а вот дураки делятся на национальности, партии, фракции и религии.