Jump to content

Cannot start apache2 on dedicated server running Ubuntu 14.04.1

After I have restarted my dedicated server I keep getting an error message whenever i restart apache2. 

 

this is the message

 

 apache2: Could not reliably determine the server's fully qualified domain name, using 2001:41d0:1:836f::1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
 
I checked the error log and It says something about the CA certificate. I don't have a clue of what is going on since was working just fine before i rebooted.
I was gussing that soem background job is using port 443 already making apache crashes when i start it, but i run the jobs and ps command and no jobs suing port 443 are running, the only thing i was using is putty itself on my local machine to connect to my server but it runs on port 22.
 
 
EDIT:
with the command lsof -f -n | grep https i was able to find the pid of the vpn server taking port 443 but i am still left with this error
 
apache2: Could not reliably determine the server's fully qualified domain name, using 2001:41d0:1:836f::1. Set the 'ServerName' directive globally to suppress this message
 
I think is about the CA certificate. I remember i created another ssl certificate so it may conflict with the server ssl certificate, I dont know i just guessing 
Link to comment
Share on other sites

Link to post
Share on other sites

You probably need to add

 

ServerName put_servername_here

 

to your /etc/apache2/apache2.conf file

CPU: Intel 3770k Cooling: Corsair H100i Motherboard: MSI Z77 MPower Memory: 2x4gb Corsair 1600 ddr3 GPU: Sapphire 6950 2gb with reference Cooler PSU: XFX pro 650w Case: Corsair Carbide 500r Storage: Crucial M4 128GB, 2x Samsung 1TB, 1x Seagate 2TB

CPU: Pentium 4 Motherboard: Gigabyte GA-8SGXL Memory: 2GB ddr Storage: 250GB IDE OS: FreeBSD

Link to comment
Share on other sites

Link to post
Share on other sites

You probably need to add

 

ServerName put_servername_here

 

to your /etc/apache2/apache2.conf file

Thanks for the help i created a servername.conf file in site-available folder and now works or at least i get my web site back online.

The problem is that when i ping my server i get 100% packet lost.

So its working but not sure if is the right way it is configure. Why would i need this new file if it was working fine without it ?

 

EDIT:

Okay I just reran the ping command and now i have 100% success, but still do not understand why i need this addition to my configuration file? I didn't change nothing until now.

I was even thinking to make a virtual host configuration since I wanted to add a second domain name but now i am afraid to mess everything up

Link to comment
Share on other sites

Link to post
Share on other sites

There's a small issue where if you install SSL using a2enmod ssl you can sometimes wind up with two port 443 listens in your /etc/apache2/ports.conf ... deleting or commenting out the extra listen will fix this problem.

 

ie, 

Listen 80Listen 443<IfModule ssl_module>        Listen 443</IfModule><IfModule mod_gnutls.c>        Listen 443</IfModule>

Change it to:

Listen 80# Listen 443<IfModule ssl_module>        Listen 443</IfModule><IfModule mod_gnutls.c>        Listen 443</IfModule>

Mine look like this:

omniomi@bitch:~$ cat /etc/apache2/ports.conf# If you just change the port or add more ports here, you will likely also# have to change the VirtualHost statement in# /etc/apache2/sites-enabled/000-default.confListen 80<IfModule ssl_module>        Listen 443</IfModule><IfModule mod_gnutls.c>        Listen 443</IfModule> 

000-default.conf looks like this:

<VirtualHost *:80>        ServerAdmin webmaster@[member=localhost]        DocumentRoot /var/www/default        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost><VirtualHost _default_:*>        DocumentRoot /var/www/default        <Directory /var/www/default>        Options +Indexes +FollowSymLinks +MultiViews        AllowOverride all        Require all granted        </Directory></VirtualHost>

and I have a 000-default-ssl.conf that looks like this:

<IfModule mod_ssl.c>        <VirtualHost _default_:443>                ServerAdmin webmaster@[member=localhost]                DocumentRoot /var/www/default                ErrorLog ${APACHE_LOG_DIR}/error.log                CustomLog ${APACHE_LOG_DIR}/access.log combined                SSLEngine on                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem                SSLCertificateKeyFile   /etc/ssl/private/ssl-cert-snakeoil.key                <FilesMatch "\.(cgi|shtml|phtml|php)$">                        SSLOptions +StdEnvVars                </FilesMatch>                <Directory /usr/lib/cgi-bin>                        SSLOptions +StdEnvVars                </Directory>                BrowserMatch "MSIE [2-6]" \                        nokeepalive ssl-unclean-shutdown \                        downgrade-1.0 force-response-1.0                BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown        </VirtualHost></IfModule>
Link to comment
Share on other sites

Link to post
Share on other sites

Thanks for the help i created a servername.conf file in site-available folder and now works or at least i get my web site back online.

The problem is that when i ping my server i get 100% packet lost.

So its working but not sure if is the right way it is configure. Why would i need this new file if it was working fine without it ?

 

EDIT:

Okay I just reran the ping command and now i have 100% success, but still do not understand why i need this addition to my configuration file? I didn't change nothing until now.

I was even thinking to make a virtual host configuration since I wanted to add a second domain name but now i am afraid to mess everything up

It's just to suppress the warning of the ServerName issue.

 

But I think you need to look at your server configuration, there is a good chance that when you restart your server, the problem will come back.

 

It's not that difficult to add another virtualhost, I would follow this guide.

CPU: Intel 3770k Cooling: Corsair H100i Motherboard: MSI Z77 MPower Memory: 2x4gb Corsair 1600 ddr3 GPU: Sapphire 6950 2gb with reference Cooler PSU: XFX pro 650w Case: Corsair Carbide 500r Storage: Crucial M4 128GB, 2x Samsung 1TB, 1x Seagate 2TB

CPU: Pentium 4 Motherboard: Gigabyte GA-8SGXL Memory: 2GB ddr Storage: 250GB IDE OS: FreeBSD

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×