Thursday 21 August 2014

Apache does not start when using Virtual Host on BITNAMI WAMP Stack

Updated on 19.12.2014

If you are using the Bitnami WAMP Stack, be careful while you setup the virtual host for your site (on local machine, Amazon EC2 or other Cloud).

First Steps:
  1. Open the /wampstack/apache2/conf/httpd.conf
  2. Search for [ conf/extra/httpd-vhosts.conf ] and uncomment that line (normally it should be line > 492 under the # Virtual hosts )
 Also, you may need to change port to 8080 or to 80 depends on your system requirement.

-------------------------------------------------------------------------------------------------------

If you are using the Bitnami WAMP Stack, be careful while you setup the virtual host for your site (on local machine, Amazon EC2 or other Cloud).

Firstly, wamp_intall_folder/apache2/conf/extra/http-vhosts.conf doesn't work anymore if you using Bitnami WAMP Stack. Instead, it uses wamp_intall_folder/apache2/conf/bitnami/bitnami-apps-vhosts.conf

1. Then, add the following content to setup of the Virtual host.
< VirtualHost *:80 >
 ServerName dev.testapp
 DocumentRoot "wamp_intall_folder/apache2/htdocs/testapp"
 
 Include "wamp_intall_folder/apps/testapp/conf/httpd-app.conf"
< /VirtualHost >


And, rest of configruation is exactly same for both.

OR Alternatevly,
you can configure same thing in a slightly different way, they rather Include the vhost.conf file and setup separately for each application.

I. First, create new folder on apps/ folder, in this case I am creating testapp/:
  wamp_intall_folder/apps/testapp

II. Then, create conf/ inside the above testapp/ folder.
  wamp_intall_folder/apps/testapp/conf


III. Then, create httpd-vhosts.conf file inside the above /conf folder;
  wamp_intall_folder/apps/testapp/conf/httpd-vhosts.conf

Then, add the below content on httpd-vhosts.conf file

< VirtualHost *:80 >
 ServerName dev.testapp
 DocumentRoot "wamp_intall_folder/apache2/htdocs/testapp"
 
 Include "wamp_intall_folder/apps/testapp/conf/httpd-app.conf"
< /VirtualHost >

IV. Further, create httpd-app.conf file inside the above /conf folder with the below content.
  wamp_intall_folder/apps/testapp/conf

 Then, add the below content on httpd-app.conf file

 < Directory "wamp_intall_folder/apache2/htdocs/testapp" >
  Options Indexes MultiViews
  AllowOverride All
  
  < IfVersion < 2.3 >
   Order allow,deny
   Allow from all
  < /IfVersion >
  
  < IfVersion >= 2.3 >
   Require all granted
  < /IfVersion >
  
 < /Directory >
 
On above steps 3 & 4, the wamp_intall_folder/apache2/htdocs/testapp is the folder where your actual project or app folder where all the php files are placed.

V. Now, lets go to the wamp_intall_folder/apache2/conf/bitnami/bitnami-apps-vhosts.conf file and add the below line
# Bitnami applications installed in a Virtual Host
Include "wamp_intall_folder/apps/testapp/conf/httpd-vhosts.conf"

2. One more step,  open the hosts file from the C:\Windows\System32\drivers\etc\hosts, in case of lixux or EC2 Server, it can be different location, please check before you add the below line.
Add the below line and save the file.
 127.0.0.1       dev.testapp

3. Finally, you have to restart the Apache server, if you browse by
http://dev.testapp/

Enjoy!

If anything, please let me know.

Tuesday 19 August 2014

To Upgrade from Joomla 2.5 to Joomla 3.x

Please follow steps to upgrade your Joomla 2.5.x website to Joomla 3.x (Tested upto version 3.3.3)
  1. Create a backup
    1. Make sure you create a full backup of your site. You can use our How to Backup a Joomla 2.5 Site tutorial if you need help with creating a backup.
       
  2. Make sure everything is up-to-date
  3. Check your system for Joomla 3 compatibility
  4. Check your extensions for Joomla 3 compatibility
  5. Create a test site
    1. Once you're sure that all your extensions are compatible, create another backup and a test site on the same server in a subfolder (be sure to create a copy of the database and not use the same one). You can use our Create a Joomla Test Site Using Akeeba Backup tutorial for that part.
       
  6. Test the upgrade in the test site
    1. Go to Components, then Joomla! Update 
    2. Click the Options button
    3. Change the Update Server to "Short Term Support"
    4. Click Save & Close
       
  7. Finally, on the test site, click the "Install the update". If all goes well, then you can do the same steps on the live site.

Note: if the "Install the update" doesn't appear right away, you may need to go to Extensions (top menu) >> Extension Manager (sub menu) >> Update (tab) >> Purge Cache (button - far right).
    After upgrading, check in Extensions (top menu) >> Extension Manager (sub menu) >> Database (side menu) and make sure there are no errors. If there are some, click on fix button.


However, before that if you find the "Joomla Update" is missing in from Admin Menu "Component" Or If Joomla Update does not shows as an installed component the menuitem could be wrong. Run this SQL statement:
UPDATE #__menu
SET component_id =
  (SELECT extension_id FROM #__extensions WHERE name = "com_joomlaupdate")
WHERE title = "com_joomlaupdate"

It should update 1 row, if not use the Discover function and install it as a component.
If Joomla Update shows as an installed component but is not in the Admin Menu under Components, you are missing the entry in the database table #__menu.

INSERT INTO `#__menu` (`menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `ordering`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`) 
VALUES ('menu', 'com_joomlaupdate', 'Joomla! Update', '', 'Joomla! Update', 'index.php?option=com_joomlaupdate', 'component', 0, 1, 1, (SELECT extension_id FROM #__extensions WHERE `name` = 'com_joomlaupdate'), 0, 0, '0000-00-00 00:00:00', 0, 0, 'class:joomlaupdate', 0, '', 41, 42, 0, '*', 1);

Replace the "#_" of #__menu and #__extensions with the prefix of your database table (System >> Global Configuration >> Server >> Database Tables Prefix).
Example: vy2bp_menu and vy2bp_extensions (only one underline)

Reference: Source 

Bitnami WAMP Stack - /phpmyadmin remote access issue as "For security reasons, this URL..............."

If you have installed the Bitnami WAMP/LAMP stack in your local and having problem to access the /phpmyadmin from remotely.
You might have seen the below error message as below:

For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname

1. In such case, you can fix it quickly by going to the 
\apps\phpmyadmin\conf

2. Open the httpd-app.conf file, and do the below steps;'
        Find the and comment the line:
        Require local  (below the line < IfVersion < = 2.3 > )
         and add the line:
        Require all granted

The code preview is shown below;

= 2.3>
#Require local
Require all granted


Friday 8 August 2014

How to enable the Remote MySQL connection on the Web Server (Cpanel)

If you are having problem to connect MySQL from Remote System, please check the following things on the Webserver Control Panel or Cpanel before connecting it.

1. Is there any local firewall running on the server, do you have the connecting servers listed in 
WHM -> SQL Services »Additional MySQL Access Hosts _and_ cPanel -> Remote MySQL?

2. If so, you've to also add a rule to CSF to allow MySQL connections. For that, go to 
WHM -> Plugins -> Configserver CSF Firewall -> Firewall Allow IPs.   

And, after that, you'll see that there is a line:
 tcp|in|d=3306|s=88.xxx.xxx.xx (your connecting computer's IP address)

which only allows incoming MySQL connections from your IP Address.
 

Email receiving issue as Gmail and other servers throws all outgoing emails to SPAM Folder?

If your website has been previously been black listed due to a pounding of SPAM emails.

Well, I am sure you definitely backed the website to normal, however, if you may face the email receiving issue for all outgoing emails from the same server. Particularly, those sending email seems delivered smoothly, however, on receivers end, they emails may be marked as spam and thrown them to SPAM folders. This often happened with GMAIL and other few servers in my case.

To resolve the above issue, the following steps may be useful;

1. Check your website (server) IP address for blacklisting by searching on below websites and delist them from there or request them to delist your IP. Please refer few websites below for checking blacklisting;
 http://multirbl.valli.org/
 http://lookup.uribl.com/
 http://www.blacklistalert.org/
 http://mxtoolbox.com/blacklists.aspx
 http://www.spamhaus.org/lookup

2. You should consider publishing SPF and DKIM records for these domains. To do that, go to your cPanel -> Email Authentication -> Enable DKIM and SPF and copy the records into the Domain DNS Manager for your domain.

The SPF (Sender Policy Framework) 
is system allows you to specify servers and IP addresses that are authorized to send mail from your domain(s). This feature works to prevent outgoing spam messages. SPF should look like below;
v=spf1 +a +mx +ip4:78.31.107.194 ?all

DKIM (DomainKeys Identified Mail) 
is a means of verifying incoming email. It ensures that incoming messages are unmodified and from the sender from whom they claim to be. This feature works to prevent incoming spam messages. DKIM should look like below;
v=DKIM1; k=rsa; p=MIGfMA0XCSqGSIb3DQEBAQUAA4GNAPCBiQKBgQDiZT6OFmmJWU/Bepyd54k3b48voH2RUzzQV7fp1vTTFGWXu72JSfBdq5ZgCMoETP/q1crHJ2ghT+X+97FVsuudY7D1Ejk6GuvleuUVQtbCfoqU11igcVqItcUttA30CSSL85riDztruFCh/1TU7SQuNNvLdoH8lcjNOWJBeAskqQIDAQAB;

If you had faced the same problem and resolved it, I would love to hear about that (comment me) here..

Wednesday 6 August 2014

How to stop Filezilla as it messes the codes (changing the linebreaks) during upload to server?

If you are pulling your hair when you see the messed up codes/contents as soon as you upload the files(well aligned codes) to the server. Normally, it happens if you are using Filezilla.

By Default, FileZilla is set to "Auto" for File Transfer Type. And, if you have any files which are in ASCII file format, then FileZilla become over-smart and will mess up with those files while transferring to the server.

To Fix that,

1. Go to FileZilla > Edit > Transfers > File Types,
2. Switch to "Binary" and Click "OK"
3. (Optional) You can restart the Filezilla.

Then, Filezilla couldn't able to mess up with your files any more.

Extra Knowledge

What you observe is perfectly normal for ASCII transfers. Different operating systems have different line-ending styles. Windows has $0D0A (), *NIX has $0A () and classic Mac had $0D (). See Data Type.

FTP in ASCII transfer type performs line ending conversion. Example: When uploading in ASCII type from Windows to Linux server, all are converted to . Thus the filesize will shrink, and binary verification tools fail on the target file. Notepad does not support UNIX style line endings and thus shows the file as one line (the rectangles are the chars), but Wordpad does (try opening the file in Wordpad to see for yourself).