I
I
Ilia Malashko2019-12-27 10:35:43
Apache HTTP Server
Ilia Malashko, 2019-12-27 10:35:43

How to set virtual hosts to the correct directory in php7?

Hello.
Initially installed on CentOS 7 LAMP with php 5.4
Configured my virtual host in /etc/httpd/conf.d/site.ru.conf

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName site.ru
ServerAlias www.site.ru
DocumentRoot /var/www/site.ru/
ErrorLog /var/www/site.ru/logs/error.log
CustomLog /var/www/site.ru/logs/access.log combined
</VirtualHost>

Все работало корректно.
Решил обновиться до php 7.2.
Установил php, посмотрел конфиги не изменились, но теперь мой хост отдает дефолтную страницу php "Testing 123..." как по ip так и по dns.
Так же создал в директории /var/www/html/ index с "Hello, world!", но все равно отдает "Testing 123..."
Как настроить, что бы apache использовал мой /etc/httpd/conf.d/site.ru.conf ?
Этот файл естественно подключен в httpd.conf
httpd.conf:
ServerRoot "/etc/httpd"
Listen 127.0.0.1:80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin [email protected]
<Directory />
    AllowOverride none
    Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
    AllowOverride None
    Require all granted
</Directory>
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
<Files ".ht*">
    Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
    LogFormat "%V %a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    ErrorLogFormat "%V [%t] [%l] [pid %P] %F: %E: [client %a] %M"
    <IfModule logio_module>
      LogFormat "%V %a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
Include conf.d/*.conf
RemoteIPHeader LOCAL-X-Real-IP

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vldud, 2019-12-27
@vldud

The question was asked incorrectly. The php version has nothing to do with apache routing. To help you, you need to see the entire web server config.

A
Alexey Dmitriev, 2019-12-27
@SignFinder

1. Look in /etc/httpd .conf for a file that might have installed php.
2. Look who hangs on ports 80 and 443 - netstat -pna

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question