У меня есть apache2, работающий на 2 файлах conf, но я не могу заставить его работать третий. Имена файлов: foxclone.conf
, test.conf
и test2.conf
в папке, доступной для сайтов. test2 - это конф, который не т работа. Я добавил test2 в файл / etc / hosts . Мой test2.conf был скопирован из test.conf и внесены изменения в путь. Когда я открываю браузер для http: // test2 , я получаю страницу по умолчанию Apache Ubuntu, а не index.html в подпапке public_html .
test2.conf
выглядит следующим образом:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName test
ServerAdmin webmaster@localhost
DocumentRoot /home/larry/web/test2/public_html/
<Directory /home/larry/web/test2/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Файл хостов выглядит следующим образом:
127.0.0.1 localhost
127.0.1.1 larry-dev2
127.0.0.1 test
127.0.0.1 test2
127.0.0.1 foxclone
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Может кто-нибудь помочь мне с этим?
Заранее спасибо.
РЕДАКТИРОВАТЬ: Забыл упомянуть, что Я перезапустил Apache.
Получил работу, отредактировав test2.conf, используя "sudo nano /etc/apache2/sites-available/test2.conf" в терминале.