V
V
Vincent12015-12-19 07:58:19
Apache HTTP Server
Vincent1, 2015-12-19 07:58:19

What is the correct way to migrate httpd.conf from apache 2.2 to apache 2.4?

Updated apache from 2.2 to 2.4. Now httpd.conf doesn't fit. I have too many domains in this file to add everything by hand on a new one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2015-12-19
@Vincent1

Don't add domains to httpd.conf
. You have FreeBSD, if I remember correctly. There, in /usr/local/etc/apache24, there is an Includes directory, and in the default httpd.conf package, at the very bottom, there is an include line that includes Include etc/apache24/Includes/*.confall files with the .conf extension in the Include directory in httpd.conf.
Move your domains/sites configuration into separate files in Includes/site1.conf, Includes/site2.conf, etc.
The default httpd.conf, by the way, requires very few changes. Most often, changes from the default config are in the following parameters:

EnableSendfile off
LoadModule php5_module libexec/apache24/libphp5.so #при инсталляции mod_php5 у вас уже должно было это появиться
Listen 127.0.0.1:80 #Или другой порт, если у вас используется nginx фронтендом, если нет - оставить Listen 80
ServerName localhost:80 #Я ставлю так, чтобы не морочиться с /etc/hosts и апач не ругался на невозможность разрешить имя
Require all granted #Если требуется. Это как бы замена Deny, Allow в apache-2.2
#Также при большом желании можно еще поменять DirectoryIndex, но не всем это надо, да и можно переопределить в отдельном файле
DirectoryIndex index.php index.html

For the rest, if you transfer the virtual hosts to separate files in Includes, you won't need anything, because the configs are practically compatible. It will only be necessary if you use Directory
Order allow,deny
Allow from all

replace with
if not allowed in the main file.
For the rest - already look at the notes issued by apachectl configtest and the logs.
So it's easier to take the default config that comes with Apache and change the necessary lines, and adapting the old config from apache-2.2 will take longer, plus you may not take into account some new parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question