I have got an website example.com
I want to have subdomain blog.example.com (which content is located in /var/www/blog).
I generated new IP for subdomain on my server. The main domain is on xxxx01 and the subdomain is on xxxx02. Evertyhing is made in domain provider.
So I made a file here apache2/sites-available/blog:
<VirtualHost xxxx02:80>
ServerName blog.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/blog
<Directory /var/www/blog>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/red-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/red-access.log combined
</VirtualHost>
I enabled subdomain with a2ensite.
etc/hosts:
127.0.0.1 localhost
xxxx02 blog.example.com
What I have to do? Help me guys please!