Tag Archives: apache2

How to Enable SSL in Apache2 on Ubuntu

In this tutorial, I’ll explain you that how to enable the SSL for your website under Apache2 on Ubuntu Server. For this, I’m assuming:

1. That you have a working apache2 setup on your Ubuntu Server.

2. You have correctly configured the dns records for your domain.

3. You already got a certificate from a trusted certificate authority (CA) such as Godaddy,Verisign, Comodo, etc.

Let’s verify our web server that it is up and running, before beginning this tutorial:

http://rbgeek.com

1

Read more of this post

How to recover deleted Apache Log

Scenario: The server is running Apache and by mistake one of the log files gets deleted. How, we can recover it?

Currently, Apache server is working perfectly:

Login/Switch to as root user:

Move to the httpd in log directory:

cd /var/log/httpd

Delete the log file:

rm -f access_log

So the log file has been deleted,now find the process number for main apache procees that owned by root:

ps aux | grep httpd

In this case, the pid for the main apache process is 1784.

Now lets list the file descriptors:

ls -lsa /proc/1784/fd

Stop the apache service:

service httpd stop

Now copy the access log file that is marked as deleted (In this case it is 7) into the log directory:

cp /proc/1784/fd/7 /var/log/httpd/access_log

Start the apache service again:

service httpd start

Access the webpage again from your server:

Verify the log file:

tail -f /var/log/httpd/access_log

It’s working 🙂

Hope this will help you!

Please Remember me in your prayers!

XAMPP – Apache service not working on Windows Xp

I’ve been installing XAMPP on Windows 7 for 2 to 3 times, which is always a simple install and Apache/PHP works fine. However, yesterday with the 1.8.0 version, I get the same problem on two Windows XP machines, here is what I downloaded:

It installed successfully without any errors:

MySQL works fine, but when I hit the “Start” button to start Apache it says “Running” and then it stops running again in like 2/3 secs:

I had tried every possible way to free the port 80. For example, Disabled option that “Use port 80” in Skype and Teamviewer as well. But, still no luck:

The solution to this problem is really simple, just download and install Microsoft Visual C++ 2008 SP1 Redistributable Package (x86):

Then hit the “Start” button to start Apache:

Type http://localhost/ and hit Enter, this time it will present you with the xampp default web page:

Hope this will help you!

Please Remember me in your prayers!

Enjoy 🙂

apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

After the initial install of Apache server, I got the following error while restarting the Apache service on Ubuntu 12.04:

The solution is really simple, just  add ServerName directive to /etc/apache2/httpd.conf :

 sudo nano /etc/apache2/httpd.conf

Add:

ServerName localhost

Finally restart the Apache server:

sudo /etc/init.d/apache2 restart

Hope this will help you!

Please Remember me in your prayers!