Showing posts with label Web Server. Show all posts
Showing posts with label Web Server. Show all posts

Wednesday, 29 July 2015

Xampp Apache and Visual Studio Port 80 conflict

If you already install Xampp Apache running into your PC and later install the Visual Studio 2015, then there will port conflicts. Normally, Visual Studio overtake the default IIS HTTP port 80 and use it.

However, if you want both to be working by running one at a time.
To do that,
Type Services.msc from the run command prompt > scroll down to World Wide Web Publishing service.
OR go to Control Panel > Administrative Tools > Services.msc > World Wide Web Publishing service.

Then, Right click  the Web Publishing and 'Stop' it, also, Go the same Properties and set a Startup type: 'Manual'.

Then, try to restart the apache. It should be working.

On the other hand, when you need to start the Visual Studio part of service, you can do same thing manually and later disable it.


Hope that helps;

Friday, 2 January 2015

Options to run multi-versions PHP within on WHM Cpanel

If you are looking for solution to run multi-version of PHP by domain in WHM Cpanel, I have found people using tools called ntPHPSelector.

WHM Cpanel doesn't have such native feature, however, I have found their team were keen to build an extension for it in future. Hopefully, it will be available soon, fingures cross!! find more here..

Currently, there are few WHM providers which does support Multiple PHP Versions as below:
  • Virtualmin since 3.99 can do that
  • PLesk since 11.5 can do that
  • Direct Admin can do that
  • cPanel cannot do that unless you move to CloudLinux paying an additional license


Now, let jump to the wayout for now;

1. First check whether the suPHP Handler is enabled or not by going to WHM > Configure PHP and suEXEC
PHP 5 Handler => suphp

If not active, run the below command
/usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1


2. Run the following commond once you logged in as root into the server (Via SSH or you can use puTTY), which may take few mintues so wait until instillation completes.
cd /usr/local/src
wget -N http://nixtree.com/download/free/ntphpselector_manage.sh
sh ntphpselector_manage.sh install

3. Go to the domain Cpanel and find the ntPHPSelector under the Software and Services to run the different version of PHP.


If you find anything, please keep on post...

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

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).

Thursday, 31 July 2014

Quick way to check for IMAP Enabled/Disabled on PHP Web server

Please execute the below syntax to check for IMAP feature enabled/disabled on your CPanel

// Code to check for just for IMAP info
var_dump(get_extension_funcs('imap'));

// Below code is to get the server configuration and check for PHP IMAP status
phpinfo();

If IMAP is enabled, the var_dump should return array of string related to imap as below;
array(75) { [0]=> string(9) "imap_open" [1]=> string(11) "imap_reopen..........

Also, if IMAP is enabled, you should able to see below information when you execute phpinfo(); as below;
IMAP
IMAP c-Client Version 2007f
SSL Support enabled

If IMAP is disabled,
Otherwise you would just able to see:  bool(false)

Tuesday, 4 March 2014

To run the Joomla controller task ( via Joomla frontend ) with CronJobs in CPanel

To run the Joomla controller task (via Joomla Frontend) with Cron Jobs (Cron Scheduler) in CPanel, please follow the below instruction.

For security: It's always better to include key for your Cron Jobs like simple param &key=someencrypetd_value with the url, then decrypt and compare inside your controller task before starting the controller task functionality.

In fact, this will help you to prevent someone executing your Cron via direct url.

And, to Set Up Cron Jobs, just login to Cpanel->Cron Jobs->add your url in below format on Command.
// Add the below link into command.
wget -O /dev/null "http://www.yourdomain.com/index.php?option=com_article&view=cronjobs&key=eyJ0eXBl"

// And it would look like below; ( it schedules the job on every 6th of every 2hrs )

*/6 */2 * * * wget -O /dev/null "http://www.yourdomain.com/index.php?option=com_article&view=cronjobs&key=eyJ0eXBl"

//
More about Cpanel CronJobs

Monday, 24 February 2014

How the HTTP Live Streaming works: The Basics of HTTP Live Streaming

The research for this article started when some of my subscription users started complaining that they could only see a few minutes of one of my longer webinars before they needed to reset their browser. At first, I thought this was caused by bad programming on our part. But, further research made me realize that iOS devices only stream about 10 minutes of continuous video content when they are connected to a cellular data network, then they stop.
Period.
This article explains why. (If you want a more technical explanation, read this Apple Support Note.)
NOTE: If any of the following conditions are true, you can ignore this article:
  • You stream all your videos off YouTube, Vimeo, or other commercial streaming service
  • Your videos run less than 10 minutes
  • No one watches your videos on an iOS mobile device (apparently, Android devices don’t have this limitation).
Understanding Live Streaming isn’t easy, but it isn’t impossible, and this article provides a cookbook you can follow which makes a lot of it fairly simple.
SOME BACKGROUND
There are two types of web video:
  • Progressive downloads
  • Streaming video

Find more on below link:

Referred: The Basics of HTTP Live Streaming

Thursday, 6 June 2013

To Install GIT on CentOS 5.2 server using WHM CPanel


It may be slightly different to install GIT on CentOS 5.2 server using WHM CPanel. However, I found below steps working for me to install it.

First, make sure you are logged in as ROOT via SSH using PUTTY application.
Then, do the following;
$ su // (login as root)
$ yum update

// To install yum fastest mirror plugin (yum-plugin-fastestmirror) you can use this command:-

$ yum install yum-fastestmirror

// OR

$ yum install yum-plugin-fastestmirror

Once the installation completed, check the plugins status by editing the file /etc/yum.conf and add the following line to the file:
$ plugins=1
// Install the dependencies

yum install gettext-devel expat-devel curl-devel zlib-devel openssl-devel

// Get the git source code ( http://distfiles.macports.org/git-core/ )
wget http://distfiles.macports.org/git-core/git-1.8.2.tar.gz


// untar/uncompress the git source code
tar xvfz git-1.6.1.tar.gz

// Install the files
cd git-1.6.1.tar.gz

make prefix=/usr/local all

make prefix=/usr/local install

Monday, 18 February 2013

301 Redirection from Multiple Domains

If you have domains: domain1.com, domain2.com and domain3.com and you want to do 301 redirection.
In this case, first:
  1. Just host the domain1.com into the server.
  2. Park the domain2.com and domain3.com under the domain1.com hosting account. 
  3. Then, create a .htaccess file on the domain1.com /public_html folder in the server. 
  4. And, the following code into the .htaccess file which is for making 301 redirection (page to page redirection) to domain1.com.
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain1\.co\.uk
RewriteRule (.*) http://www.domain1.co.uk/$1 [R=301,L]