Results 1 to 10 of 27
I want to use the domain name, but it gets ignored by apache2 server.
As result, I cannot access my webpage.
Here is an error:
Code:
root[at]Debian-60-squeeze-64-minimal:~# /etc/init.d/apache2 restart
Restarting ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-21-2012 #1Just Joined!
- Join Date
- Aug 2012
- Posts
- 11
apache2 server ignores the domain name
I want to use the domain name, but it gets ignored by apache2 server.
As result, I cannot access my webpage.
Here is an error:
/etc/apache2/sites-enabled/mysite text file contains the following:Code:root[at]Debian-60-squeeze-64-minimal:~# /etc/init.d/apache2 restart Restarting web server: apache2[Tue Aug 21 15:12:02 2012] [error] (EAI 2)Name or service not known: Could not resolve host name *;80 -- ignoring! [Tue Aug 21 15:12:02 2012] [error] (EAI 2)Name or service not known: Could not resolve host name *;80 -- ignoring! apache2: Could not reliably determine the server's fully qualified domain name, using IP-address for ServerName *... waiting [Tue Aug 21 15:12:03 2012] [error] (EAI 2)Name or service not known: Could not resolve host name *;80 -- ignoring! [Tue Aug 21 15:12:03 2012] [error] (EAI 2)Name or service not known: Could not resolve host name *;80 -- ignoring! apache2: Could not reliably determine the server's fully qualified domain name, using IP-address for ServerName
httр.conf file is emptyCode:<VirtualHost *;80> ServerName mysitecom ServerAlias mysitecom DocumentRoot /var/www/mysite </VirtualHost> <VirtualHost *;80> ServerName wwwmysitecom ServerAlias wwwmysitecom DocumentRoot /var/www/mysite </VirtualHost>
Last edited by black_penguin; 08-21-2012 at 03:29 PM.
- 08-22-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,745
are those semi-colons?
change them to colons, e.g.:Code:<VirtualHost *;80>
Code:<VirtualHost *:80>
- 08-22-2012 #3Just Joined!
- Join Date
- Aug 2012
- Posts
- 11
Thank you. Already fixed many errors.
Now apache2 starts normally, but I still cannot access the website using domain name.
During launch, apache2 outputs the following:
Code:root@Debian-60-squeeze-64-minimal:~# service apache2 restart Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 178.63.95.207 for ServerName ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 178.63.95.207 for ServerName .
- 08-22-2012 #4Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,745
Are the hostnames you've defined in your virtualHosts section (e.g., wwwmysitecom, mysitecom) resolvable to an IP address? If they are not valid DNS entries (or you're not using DNS), you can simply add entries for them in /etc/hosts, pointing to your local ip address. assuming it is the ip address listed in the above apache error, you could put:
for <local_hostname>, just substitute whatever is your real hostname (i.e., the output of the hostname command).Code:178.63.95.207 <local_hostname> wwwmysitecom mysitecom
also, in your httpd.conf file you can define ServerName with the loopback ip address (127.0.0.1).
After changes, restart the apache server.
- 08-23-2012 #5Linux Enthusiast
- Join Date
- Apr 2012
- Location
- Virginia, USA
- Posts
- 573
I believe apache2.conf is the default config file for debian.
- 08-23-2012 #6Just Joined!
- Join Date
- Aug 2012
- Posts
- 11
- 08-23-2012 #7
Run
on the server and then edit your apache config file and addCode:hostname
to get rid of that message, although it shouldn't actually stop Apache from starting.Code:ServerName OUTPUT FROM THE hostname COMMAND HERE
Last edited by elija; 08-23-2012 at 11:35 AM. Reason: Removing chevrons as they could be confusing
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
Snakey Wakey!
The Fifth Continent reborn
- 08-23-2012 #8Just Joined!
- Join Date
- Aug 2012
- Posts
- 11
- 08-23-2012 #9Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,745
and is Debian-60-squeeze-64-minimal resolvable to an ip address (in /etc/hosts or DNS)?
which apache config file are you editing? can you display it's path and maybe also post it? are your virtualhost declarations in the same file? post those too, if not in the default config file.Last edited by atreyu; 08-23-2012 at 10:44 PM. Reason: format
- 08-24-2012 #10Just Joined!
- Join Date
- Aug 2012
- Posts
- 11
/etc/hosts file:
Virtual hosts declarations could be seen in /etc/apache2/sites-available/mysite text file:Code:### Hetzner Online AG installimage # nameserver config # IPv4 # ServerName Debian-60-squeeze-64-minimal 127.0.0.1 targetcraft 178.63.95.207 Debian-60-squeeze-64-minimal # # IPv6 ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
/etc/apache2/sites-enabled/mysite is the link to previous text fileCode:<VirtualHost *;80> ServerName mysitecom ServerAlias mysitecom DocumentRoot /var/www/mysite </VirtualHost> <VirtualHost *;80> ServerName wwwmysitecom ServerAlias wwwmysitecom DocumentRoot /var/www/mysite </VirtualHost>


Reply With Quote

