Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Apache question.

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Apache question.

#1 Post by hack3rcon »

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?

Code: Select all

# 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?

Code: Select all

# cat /etc/hostname
#localhost.localdomain
example-test.net
And:

Code: Select all

# cat /etc/hosts
#127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.2   example-test.net   example-test
It is a great help if anyone answer my questions by number.

Thank you.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Apache question.

#2 Post by dilberts_left_nut »

1 No. Any. Just specify whatever you want the vhost to answer to.
2. Probably - check 'man openssl'
3.Yes. No.
4. Irrelevant. Makes no difference to your webserver.
AdrianTM wrote:There's no hacker in my grandma...

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: Apache question.

#3 Post by hack3rcon »

dilberts_left_nut wrote:1 No. Any. Just specify whatever you want the vhost to answer to.
2. Probably - check 'man openssl'
3.Yes. No.
4. Irrelevant. Makes no difference to your webserver.
Thank you for your reply. I asked that questions because of HTTPS certificate.

1- If they are not important then what is their usage? I think Let's Encrypt see the Apache configuration or Virtual Host configuration file for select the website name automatically.
4- I got a certificate when my server name was "localhost.localdomain" and when I changed the "hostname" and "hosts" files then it cause some problem. If these files make no difference to my server then why they exist?
The /etc/hosts is an operating system file that translate hostnames or domain names to IP addresses.
The /etc/hostname contains name of the machine, as known to applications that run locally.

They are not important for get a HTTPS certificate?

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: Apache question.

#4 Post by reinob »

You should really ask the questions you have instead of about other questions/solutions that you think might be related.

You get a certificate for a domain, which should resolve to a publically addressable IP address (i.e. not 192.168.. or such).
Apache configuration is another thing. Maybe it's time you really RTFM before you continue.

Apache has excellent documentation.
Certbot (if that's what you're using for letsencrypt) is also very well documented.

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: Apache question.

#5 Post by hack3rcon »

reinob wrote:You should really ask the questions you have instead of about other questions/solutions that you think might be related.

You get a certificate for a domain, which should resolve to a publically addressable IP address (i.e. not 192.168.. or such).
Apache configuration is another thing. Maybe it's time you really RTFM before you continue.

Apache has excellent documentation.
Certbot (if that's what you're using for letsencrypt) is also very well documented.
As I said, the IP is an example and I know that it must a public IP.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Apache question.

#6 Post by cuckooflew »

reinob wrote:You should really ask the questions you have instead of about other questions/solutions that you think might be related.

You get a certificate for a domain, which should resolve to a publically addressable IP address (i.e. not 192.168.. or such).
Apache configuration is another thing. Maybe it's time you really RTFM before you continue.

Apache has excellent documentation.
Certbot (if that's what you're using for letsencrypt) is also very well documented.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

Post Reply