Вопрос

I have an application, working at domain example.com, I want configure subdomains ru.example.com. Rails + Passenger + Apache

/etc/apache2/sites-available/example

<VirtualHost *:80>
  DocumentRoot /var/www/myapp/public  
  <Directory /var/www/myapp/public>
    AllowOverride all
    Options -MultiViews
  </Directory>
</VirtualHost>

I tried copy VirtualHost section and change ServerName to ru.example.com and restart apache by command "apachectl restart", but address "ru.example.com" don't work

What i need to solve this?

UPDATE

I need to contact DNS provider and open subdomains, in conf - only copy VH section with different ServerName

Это было полезно?

Решение

Just add an entry in your hosts file for ru.example.com to point to 127.0.0.1. Not sure your OS, but you should be able to find the steps on Google, it's pretty easy.

Edit:

Try adding this line to your config:

ServerAlias example.com ru.example.com
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top