Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Sep 02, 2015 1:34 pm 
Offline
Senior Newbie

Joined: Sat Aug 29, 2015 5:51 am
Posts: 5
Sorry again for this basic questions but i see that many developers have not clear ideas :)

This is my subdomain: subdomain.example.com that want to use for a very simple rail app.
This is my .conf file:

Code:
# domain: subdomain.example.com
# public: /var/www/subdomain.example.com/public_html/

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@example.com
  ServerName  www.subdomain.example.com
  ServerAlias subdomain.example.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/subdomain.example.com/public_html
 
  <Directory /var/www/subdomain.example.com/public_html>

  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/subdomain.example.com/log/error.log
  CustomLog /var/www/subdomain.example.com/log/access.log combined
</VirtualHost>


The question is: the ServerAlias must be "subdomain.example.com" OR "example.com"?
And please confirm, this setting is independent if i manage my domains DNS from "Linode DNS Manager" OR from my "Registrar DNS Panel"?


Top
   
PostPosted: Sun Sep 06, 2015 9:50 pm 
Offline
Newbie

Joined: Sun Sep 06, 2015 9:42 pm
Posts: 2
so why you use "www.subdomain.example.com" ?
if you want to create subdomain it's better just create subdomain.example.com, it think if you use www.subdomain.example.com it's subdomain in subdomain.
serveralias is just optional you just need ServerName subdomain.example.com if you want to create subdomain.example.com

so the conf is:
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@example.com
ServerName subdomain.example.com

# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/subdomain.example.com/public_html

<Directory /var/www/subdomain.example.com/public_html>

# Log file locations
LogLevel warn
ErrorLog /var/www/subdomain.example.com/log/error.log
CustomLog /var/www/subdomain.example.com/log/access.log combined
</VirtualHost>

_________________
APKTrunk - Android APK Collection


Top
   
PostPosted: Tue Sep 08, 2015 9:57 am 
Offline
Linode Staff

Joined: Mon Sep 29, 2014 4:47 pm
Posts: 90
Twitter: FelicianoTech
That's actually how I would do it.

jessicarey wrote:
so why you use "www.subdomain.example.com" ?
if you want to create subdomain it's better just create subdomain.example.com, it think if you use http://www.subdomain.example.com it's subdomain in subdomain.
serveralias is just optional you just need ServerName subdomain.example.com if you want to create subdomain.example.com

so the conf is:
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@example.com
ServerName subdomain.example.com

# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/subdomain.example.com/public_html

<Directory /var/www/subdomain.example.com/public_html>

# Log file locations
LogLevel warn
ErrorLog /var/www/subdomain.example.com/log/error.log
CustomLog /var/www/subdomain.example.com/log/access.log combined
</VirtualHost>


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group