문제

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