Welcome to the Linux Foundation Forum!

Apache and server.

Posts: 1
edited September 2020 in System Management

Hello,

I have some questions about Apache configuration and I'm thankful if anyone help me.


1- In Apache configuration, both of "ServerName" and "ServerAlias" must be defined? Which one must have "www" prefix ?


2- If "/etc/pki/tls/private/localhost.key" and

"/etc/ssl/certs/localhost.crt" files deleted then how can I regenerate them? Is below command OK?

  1. # openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/tls/private/localhost.key -out /etc/ssl/certs/localhost.crt


The "localhost" is the name of my host? If my hostname is "example-test" then these files name must be "example-test.key" and "example-test.crt" ?


3- By default, Linux use "localhost.localdomain" if I installed Apache and my web site is up too then can I change "localhost.localdomain" ? Can it make any problem?


4- For a web site with the name "example-test.net" and "192.168.1.2" IP address, what is the content of "/etc/hostname" and "/etc/hosts" files? Is below configuration OK?

  1. # cat /etc/hostname
  2. #localhost.localdomain
  3. example-test.net


And:

  1. # cat /etc/hosts
  2. #127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  3. #::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  4. 192.168.1.2 example-test.net example-test


It is a great help if anyone answer my questions by number.

Thank you.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training