"ServerName" and "ServerAlias".

Issues related to configuring your network
Post Reply
hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

"ServerName" and "ServerAlias".

Post by hack3rcon » 2020/09/02 07:49:33

Hello,
In Apache configuration, both of "ServerName" and "ServerAlias" must be defined?
ServerName: Hostname and port that the server uses to identify itself.
ServerAlias: Alternate names for a host used when matching requests to name-virtual hosts.

ServerName can accept port numbers as well, while ServerAlias cannot.
ServerAlias can accept wildcards (eg. *.mywebsite.com), while ServerName cannot.
"ServerName" should have "www" or "ServerAlias" ? For example, www.example.com

Thank you.

User avatar
KernelOops
Posts: 322
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: "ServerName" and "ServerAlias".

Post by KernelOops » 2020/09/02 20:47:40

ServerName is required for proper host handling, while ServerAlias is optional.
--
I love my computer - all my friends live there.
--

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: "ServerName" and "ServerAlias".

Post by hack3rcon » 2020/09/03 10:53:06

KernelOops wrote:
2020/09/02 20:47:40
ServerName is required for proper host handling, while ServerAlias is optional.
Servername should have "www"?

User avatar
KernelOops
Posts: 322
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: "ServerName" and "ServerAlias".

Post by KernelOops » 2020/09/03 11:50:31

It may have a www or it may not. It depends on your setup and requirements. Most people use ServerAlias for the www.
--
I love my computer - all my friends live there.
--

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: "ServerName" and "ServerAlias".

Post by hack3rcon » 2020/09/03 13:26:20

KernelOops wrote:
2020/09/03 11:50:31
It may have a www or it may not. It depends on your setup and requirements. Most people use ServerAlias for the www.
"depends on your setup and requirements" ? How can I understand it need "www" or not?

User avatar
TrevorH
Forum Moderator
Posts: 29491
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: "ServerName" and "ServerAlias".

Post by TrevorH » 2020/09/03 15:28:58

"depends on your setup and requirements" ? How can I understand it need "www" or not?
It's *your* server. You should know this. In fact, ONLY you can know this.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: "ServerName" and "ServerAlias".

Post by hack3rcon » 2020/09/03 15:40:31

TrevorH wrote:
2020/09/03 15:28:58
"depends on your setup and requirements" ? How can I understand it need "www" or not?
It's *your* server. You should know this. In fact, ONLY you can know this.
Excuse me, I can't understand it.
If a web site name is "mydomain.net" then how about the configuration?

User avatar
TrevorH
Forum Moderator
Posts: 29491
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: "ServerName" and "ServerAlias".

Post by TrevorH » 2020/09/03 15:44:36

Do *you* want to be able to use the server by both names? If not then you only need to tell it to use the one that you want it to use. If you want it to be known as both then you need to tell it so.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: "ServerName" and "ServerAlias".

Post by hack3rcon » 2020/09/03 15:55:22

TrevorH wrote:
2020/09/03 15:44:36
Do *you* want to be able to use the server by both names? If not then you only need to tell it to use the one that you want it to use. If you want it to be known as both then you need to tell it so.
Both names?

Post Reply

Return to “CentOS 8 - Networking Support”