Introduction
This is an article where the main focus is to discuss an error message. The error message description exist in the title of this article. The error message is ‘ERROR: Site does not exist !’. That error message appear on executing a command to activate a website in Apache Webserver.The Apache Webserver in this context exists in a Ubuntu Linux operating system. Specifically, it is a Linux Ubuntu 18.4 version. Back to the focus on error appearing at the activation step. The activation process itself is actually done by typing a certain command in the command line interface. There are sequence of steps before the execution of the command as follows :
1. Create a file containing a website configuration for Apache Webserver. The content is not the main focus in this article. Just make sure that every line of the configuration is valid. Don’t forget to place it in the correct location. Usually, in Linux Ubuntu 18.04, it is actually exist in /etc/apache2/sites-available.
2. After successfully create the file, just execute the following command pattern :
a2ensite the-file-configuration-name
The execution command using the above command pattern exist as follows :
root@hostname ~# a2ensite 001-site-configuration ERROR: Site 001-site-configuration does not exist! root@hostname ~#
Solving the Problem
1. Solving the above error message is quite simple. Just check whether the file with the name of 001-site-configuration.conf exist in /etc/apache2/sites-available. The above error message output informing that the file with the name 001-site-configuration is not exist. The file with the name 001-site-configuration.conf is actually a specific file to define the site referred in the content of the configuration file. Make sure the file with the name 001-site-configuration.conf exist. Not only the name must be exactly the same but also the extension of the file must be a .conf file. The location of the file itself must also correct. Since it is the Apache Webserver, the file must be exist in the apache folder configuration.
2. After checking all the aspects, including the file name, the location name and also the extension of the file, just re-execute the above command. The following is the actual execution of the above command :
root@hostname sites-available(keystone)# a2ensite 001-site-configuration Enabling site 004-site-configuration. To activate the new configuration, you need to run: systemctl reload apache2 root@hostname sites-available(keystone)# systemctl reload apache2 apache2.service is not active, cannot reload.
The execution of the above command is possible even when the Apache Webserver’s service is off. In order to view the impact of the above command execution just start the Apache Webserver’s service. Access the URL of the website specified in the configuration file in the browser.
- Печать
Страницы: [1] Вниз
Тема: ERROR: Site test does not exist! (Прочитано 21614 раз)
0 Пользователей и 1 Гость просматривают эту тему.

Ale}{ander
при попытке ввести в командную строку
a2ensite testвыдаёт такую фигню
ERROR: Site test does not existвот мой файл template
всю настройку сервака делал по этой инструкции http://www.sdelaysite.com/besplatnoe-po/ustanovka-apache-php-mysql-ubuntu-2
вот права доступа к файлу test
-rwxrwx--- 1 alexander alexander 359
ТС не появлялся на Форуме более полугода по состоянию на 22/07/2019 (последняя явка: 10/11/2013). Модератором раздела принято решение закрыть тему.
—zg_nico
« Последнее редактирование: 22 Июля 2019, 15:33:48 от zg_nico »

MrUsKLON
с месяц назад тоже пробовал поставить LAMP , нечего не вышло. Кто даст линк на работающий гайд или пояснения в текущем буду очень рад

Vigo Stavrian
Не откажусь от WM Z278445196786, R570439882678, U122543242692. Яндекс.деньги 410011168274432

Ale}{ander
Я не LAMP -ом ставил, а всё ручками по отдельности

Vigo Stavrian
2Ale}{ander,
А прочитать то что я дал по ссылке тяжело до конца? Там есть и настройка апача твоего.
Не откажусь от WM Z278445196786, R570439882678, U122543242692. Яндекс.деньги 410011168274432

denverkurt
шаблон сайта сохраняем так:
/etc/apache2/sites-available/template.conf
потом выполнить команду
a2ensite template
delovoy
а так?
cd /etc/apache2/sites-available/
sudo a2ensite template

SvMidi
Что ж вас всех сразу на виртуальные хосты то тянет.
Я знаю только то, что ничего не знаю, остальные не знают и этого.
delovoy
Что ж вас всех сразу на виртуальные хосты то тянет.
Ведь удобно, вот и тянет =)

thunderamur

Kernel Kiddy
Время прошло, но, может, кому поможет
Файлы конфигурации, по умолчанию, должны иметь расширение ‘.conf’. Иначе утилита их не видит.
Ubuntu Server 12.04 x86_64

BSB
Kernel Kiddy, спасибо, что вы есть. Оно, конечно, тысячу раз написано во всех статьях, пару десятков раз я, к примеру, натыкался на одну и ту же проблему, но когда голова забита другим, мелочи вылетают. А вот советы, типа прочти стотонный толмуд ради плевой проблемы, вместе с тем, когда автор понимает, в чем действительно проблема — это я считаю откровенной издевкой!

Gayrat68
Добрый день, прочитал несколько раз документацию, не помогло
исходные данные: Ubuntu 16, apache
В директории /etc/apache2/sites-enabled
создал файл example.com.conf
Со следующим содержимым:
Listen 80
<VirtualHost *:80>
DocumentRoot /www/example.com
ServerName www.example.com
</VirtualHost>
создал папку /www/example.com
В файл /etc/hosts внес запись:
127.0.0.1 example.com
дал команду:
cd /etc/apache2/sites-enabled
sudo a2ensite example.com.conf
И получаю ответ:
ERROR: Site example.com does not exists
Подскажите пожалуйста — что не так?
Ведь все сделал по manual ?
Пользователь добавил сообщение 08 Октября 2018, 11:53:56:
Решено.
Оказывается конфигурационные файлы надо создавать в директории:
sites-available
« Последнее редактирование: 08 Октября 2018, 11:53:56 от Gayrat68 »

victor00000
sudo strace -f a2ensite test 2>&1 | grep -o "".*/test..*""
- Печать
Страницы: [1] Вверх
- Forum
- The Ubuntu Forum Community
- Ubuntu Specialised Support
- Ubuntu Servers, Cloud and Juju
- Server Platforms
- [ubuntu] a2ensite — Error! Site does not exist
-
a2ensite — Error! Site does not exist
when I run a2ensite with «a2ensite www.example.com»I get the errorI’ve added a file in the sites-enabled folder in /etc/apache2/sitesenabled
I’ve added a site in /var/www/www.example.com/I’ve even tried running a2ensite in each of the folders…
running a2ensite and pointing it to the file in the enabled-sites foldera2ensite /etc/apache2/sites-enabled/www.example.com
gives the error:
ERROR: No site found matching /etc/apache2/sites-enabled/www.example.com!
This is my www.example.com file in sites-enabled:
<VirtualHost *>
ServerAdmin webmaster@example.com
ServerName www.example.com
ServerAlias example.com# Indexes + Directory Root.
DirectoryIndex index.html
DocumentRoot /var/www/www.example.com/
</VirtualHost>Where have I gone wrong?
-
Re: a2ensite — Error! Site does not exist
I believe that /etc/apache2/sites-available is the default for containing the relevant configuration files, and then a2ensite creates the proper link/files in /etc/apache2/sites-enabled
-
Re: a2ensite — Error! Site does not exist
I just tried moving it over and running it again, but I get the same error
-
Re: a2ensite — Error! Site does not exist
What is the output of the following:
Code:
ls -l /etc/apache2/sites-available
If you have a file called «www.example.com», then simply run:
Code:
sudo a2ensite www.example.com
You should not need to point a2ensite at the entire directory tree, Apache2 will specifically look in /etc/apache2/sites-available.
Nothing is ever easy, but if it is difficult you must be doing it wrong.
-
Re: a2ensite — Error! Site does not exist
I know this thread is a little bit older…
but I had the same problem and came to this place. Renaming the file to example.conf did the job for me; so the .conf extension seemed to be necessary…
-
Re: a2ensite — Error! Site does not exist
Originally Posted by dapleh
I know this thread is a little bit older…
but I had the same problem and came to this place. Renaming the file to example.conf did the job for me; so the .conf extension seemed to be necessary…
Never too old, thanks
-
Re: a2ensite — Error! Site does not exist
That’s because the files in sites-enabled are included in the configuration by this directive in /etc/apache2/apache2.conf:
Code:
# Include the virtual host configurations: IncludeOptional sites-enabled/*.conf
It only reads files matching *.conf.
-
Re: a2ensite — Error! Site does not exist
This seems to be quite a recent change in Ubuntu and caused me quite a bit of head-scratching. If you are on 12.10 then the virtual host file does not have to end in .conf but by 13.10 it does.
-
Re: a2ensite — Error! Site does not exist
I kinda feel compelled to make mention of this because I have been helped by this thread on more than one occasion.
It’s May 2014 and Ubuntu 14.04 has been out for a little while. Navigate to /etc/apache2/sites-available and see what’s there. In the past the default website file has just been named «default» while later it was «default.conf» yet now it is «000-default.conf.»
«sudo a2dissite 000-default.conf» disables the default web site, allowing you to promote another one in its place.
Hope this helps!
Warren
-
Re: a2ensite — Error! Site does not exist
Originally Posted by Warren_Parker
«sudo a2dissite 000-default.conf» disables the default web site, allowing you to promote another one in its place.
Thank you for leaving this update, everyone left «000-» part out of the instructions (…ugh)
I also needed to add the .conf extension to promote the other site that I replaced it with «sudo a2ensite exampleAltSite.conf»thanks for posting this





