Answer the question
In order to leave comments, you need to log in
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
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/*.conf
all 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
Order allow,deny
Allow from all
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question