"ServerName" and "ServerAlias".

Issues related to configuring your network
Post Reply
hack3rcon
Posts: 757
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: 428
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.
--
R.I.P. CentOS :cry:
--

hack3rcon
Posts: 757
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: 428
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.
--
R.I.P. CentOS :cry:
--

hack3rcon
Posts: 757
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
Site Admin
Posts: 33218
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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hack3rcon
Posts: 757
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
Site Admin
Posts: 33218
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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hack3rcon
Posts: 757
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