Which config file is fit for my apache2?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "=?gb18030?b?dXNlcnM=?=" <users@xxxxxxxxxxxxxxxx>
- Subject: Which config file is fit for my apache2?
- From: "=?gb18030?b?y66+ssH3ye4=?=" <1248283536@xxxxxx>
- Date: Wed, 16 Nov 2016 12:33:16 +0800
- Feedback-id: webmail:qq.com:bgforeign:bgforeign3
- Reply-to: users@xxxxxxxxxxxxxxxx
Let's suppose a scene on centos7.
- domain name: xyz.com
- the domain parsed by third-party dns server: ns1.xxx.com
- IP address bound with domain: 123.123.123.123
- apache2 was installed on 123.123.123.123
It is the ServerName confused me.
### ServerName
In the `/etc/httpd/conf/httpd.conf`, `ServerName` gives the name and port that the server uses to identify itself. This can often be determined automatically, but we recommend you specify it explicitly to prevent problems during startup. If your host doesn't have a registered DNS name, enter its IP address here.
#ServerName [url]www.example.com:80[/url]
Should my /etc/httpd/conf/httpd.conf be this way :
config1:
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerName 123.123.123.123:80
<VirtualHost *:80>
ServerName [url]www.xyz.com[/url]
DocumentRoot "/var/www/html"
</VirtualHost>
config2:
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerName xyz.com:80
<VirtualHost *:80>
ServerName [url]www.xyz.com[/url]
DocumentRoot "/var/www/html"
</VirtualHost>
config3:
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerName localhost:80
<VirtualHost *:80>
ServerName [url]www.xyz.com[/url]
DocumentRoot "/var/www/html"
</VirtualHost>
config4:
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerName 127.0.0.1:80
<VirtualHost *:80>
ServerName [url]www.xyz.com[/url]
DocumentRoot "/var/www/html"
</VirtualHost>
Which config file is fit for my example?
[Index of Archives]
[Open SSH Users]
[Linux ACPI]
[Linux Kernel]
[Linux Laptop]
[Kernel Newbies]
[Security]
[Netfilter]
[Bugtraq]
[Squid]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Samba]
[Video 4 Linux]
[Device Mapper]