G
G
goldwizard132017-03-08 09:48:17
Domain Name System
goldwizard13, 2017-03-08 09:48:17

Debian 7, how to set up a subdomain?

I use a DNS server from Yandex, the script is divided into frontend and backend (admin panel), I configured the front end, created /etc/apache2/sites-available/site.ru.conf where it redirects to frontend/www, everything works, now I want to configure admin panel at admin.site.ru redirecting to backend/www, , tried to set it up as the main domain but it doesn't work The server was not found, what should I do?
created sudo nano /etc/apache2/sites-available/site.ru.conf
in it

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName сайт.ру
ServerSignature Off
        DocumentRoot /var/www/сайт.ру/frontend/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/сайт.ру/frontend/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
  </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

then sudo a2ensite site.ru.conf
sudo service apache2 restart
all the frontend worked, all links work until I found no problems . sites-available/admins.site.ru.conf in it
<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName admins.сайт.ру
        DocumentRoot /var/www/сайт.ру/backend/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/сайт.ру/backend/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
  </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

then sudo a2ensite admins.site.ru.conf
sudo service apache2 restart
go to subdomain server not found

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Falseclock, 2017-03-08
@goldwizard13

and who or what generally resolves the names?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question