Привет, я новый для Apache и пытаясь научиться проводить несколько веб-сайтов.
У меня 2 домены www.daily-updates.ga
& www.prudent-solutions.co.in
и сервер VPS с Ubuntu 18.04 и Apache2. Я могу увидеть страницу по умолчанию Apache, когда я перехожу на IP-адрес своего сервера с другого ПК.
Как следующий шаг, который я создал 2 тестовых сайта и 2 каталога в / var / www
. Я также скопировал файл конфигурации по умолчанию и изменил значение ServerName, ServerAlias, Documentroot
для обоих веб-запасов.
Daily-updates.ga.conf:
<VirtualHost *:80>
ServerName daily-updates.ga
ServerAlias www.daily-updates.ga
DocumentRoot /var/www/daily-updates.ga/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
PRUDENT-Solutions.co.in:
<VirtualHost *:80>
ServerName prudent-solutions.co.in
ServerAlias www.prudent-solutions.co.in
DocumentRoot /var/www/prudent-solutions.co.in/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
APACHE2.conf
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf.d
# | `-- *
# Global configuration
PidFile ${APACHE_PID_FILE}
Timeout 30
KeepAlive Off
MaxKeepAliveRequests 300
KeepAliveTimeout 10
<IfModule mpm_prefork_module>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 200
MaxRequestsPerChild 4000
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 200
MaxRequestsPerChild 4000
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 200
MaxRequestsPerChild 4000
</IfModule>
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#User www-data
#Group www-data
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>
DefaultType None
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf
# Include list of ports to listen on and which to use for name based vhosts
Include ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%b" bytes
Include conf.d/
# Include the virtual host configurations:
#Include sites-enabled/
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 500 /error/50x.html
ErrorDocument 501 /error/50x.html
ErrorDocument 502 /error/50x.html
ErrorDocument 503 /error/50x.html
ErrorDocument 506 /error/50x.html
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/prudent-solutions.co.in>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Я затем включил те, которые на A2ensite
команда
m Уверен, что мои данные DNS идеальны и указываются на IP-адрес моего сервера. Тем не менее, когда я хожу в www.daily-updates.ga
или www.prudent-solutions.co.in
Я все еще вижу только страницу по умолчанию Apache2
www.prudent-solutions.co.in
:
Скриншот страницы по умолчанию
аналогично, когда я перехожу в www.daily-updates.ga
Я получаю ту же страницу.
Что я делаю не так? Почему я не могу видеть правильный сайт? Я знаю, что моя есть ошибка в CONT File, но не может понять это
, пожалуйста, помогите !!!
Если кто-то сталкивается с такой же проблемой, как я, затем обновляю Ubuntu и Apache в последнюю доступную версию.
Поверьте мне, это работает как очарование. :)