-
Apache warning message on Ubuntu 10.04: ‘__default__ VirtualHost overlap on port 443, the first has precedence’
Got this message when I restarted the apache2 daemon after I added a new virtual host in /etc/apache2/sites-available/default-ssl on Ubuntu 10.04:
[warn] _default_ VirtualHost overlap on port 443, the first has precedence
I checked the other Apache config files and inside /etc/apache2/ports.conf there’s a comment on what to do:
Step 1. Add NameVirtualhost *:443 entry in ports.conf (inside <IfModule mod_ssl.c>)
NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. NameVirtualHost *:443 Listen 443 </IfModule>Step 2. Change the VirtualHost statement in /etc/apache2/sites-available/default-ssl
Replace <VirtualHost __default__:443> with <VirtualHost *:443> (as mentioned in the comment in ports.conf).
Step 3. Restart Apache and check if SSL is working fine for all of your virtual hosts
-
Ubuntu 10.04: Apache using up all of your server’s memory? Consider using apache2-mpm-worker
I was checking my site yesterday morning and noticed it was responding very very slowly. The server running it only has 256MB of RAM, which I estimated shouldn’t be a problem at all with the amount of traffic I’m currently getting. I quickly logged in to the server to check the resource usage and found that the Apache daemon was using up pretty much all the RAM and virtual memory!
After some researching, I discovered that the Apache Multi-Processing Module (MPM) that I’m using is the “prefork” one (apache2-mpm-prefork), which basically creates/forks a new process to handle each connection. The “worker” (threaded) MPM (apache2-mpm-worker) is considered to be faster with a smaller memory footprint and I’ve seen posts in forums suggesting to switch to this one and see what happens.
It looks like aptitude installed the “prefork” MPM by default because the PHP5 library I installed required it. Switching to the “worker” MPM made a huge difference for me, I’m only using about half my RAM and very little virtual memory now.
To use the “worker” MPM with PHP, do the following:
Step 1. Stop the apache2 daemon
sudo /etc/init.d/apache2 stop
Step 2. Uninstall apache2-mpm-prefork
sudo aptitude remove apache2-mpm-prefork
Step 3. Install apache2-mpm-worker and apache2-threaded-dev
sudo aptitude install apache2-mpm-worker apache2-threaded-dev
Step 4. Enable CGI and mod_actions (may already be enabled)
sudo a2enmod cgid sudo a2enmod actions
Step 5. Create a file in /etc/apache2/conf.d with the following content (I called mine php5-cgi.conf):
<IfModule mod_actions.c> Action application/x-httpd-php /cgi-bin/php5 </IfModule>Step 6. Start the apache2 daemon
sudo /etc/init.d/apache2 start
Sources:
-
Migrating WordPress from a shared hosting environment to a virtual private server
Posted on November 9th, 2011 3 comments
Print
I was migrating this WordPress blog early this morning from Bluehost to a dedicated Rackspace Cloud Server that I’m already using for a web application I’m writing. It was almost painless! Just ran into a few minor post-migration issues.
The reason I’m migrating is mainly because I want more control, like being able to use my own self-signed SSL certificate without paying extra, for example. I figured since I’m getting very low traffic it really wouldn’t cost me anything extra to host it on Rackspace.
For example, according to Bluehost, my monthly bandwidth transfer is roughly 2.3GB. I’m not sure if that’s for both inbound and outbound. Either way, Rackspace only charges 18 cents/GB for outbound bandwidth (inbound is free). So even if I’m using 3GB a month, it’s only an extra 54 cents to my monthly cost. Rackspace’s connection is also way faster.
The migration steps are pretty straighforward, basically:
- Install PHP, MySQL, Apache.
- Install WordPress.
- Restore the database.
- Copy over your themes, uploads, plugins, and other directories that a plugin might be using (in my case I had an extra “gallery” directory for the NextGEN Gallery plugin that I’m using to store my pictures).
- Restart Apache.
Here are the issues I ran into after migration and their solutions:


Recent Comments