Category Archives: Hosting

How to know which port MySQL is running on – Ubuntu

To find a listener on a port, do this:

You should see a line that looks like this if mysql is indeed listening on that port.

 reference: stackoverflow.com

Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration

Apache shows this error message when you don’t have mod_rewrite enabled. To enable it follow below steps

1. cd to apache2 (usually in cd /etc/apache2 )

2. enter this command – sudo a2enmod rewrite

3. now restart the apache service – sudo service apache2 restart

That’s it !

 

PhpMyadmin is not working after installation on Ubuntu

I have installed Phpmyadmin on  my Ubuntu Server, but while accessing it I am getting

The requested URL /phpmyadmin was not found on this server.

Error message, I have found following solution which worked for me.

  1. Add the following line to the end of of file /etc/apache2/apache2.conf:
  2. to add this line enter this command  sudo nano /etc/apache2/apache2.conf
  3. Include /etc/phpmyadmin/apache.conf

  4. Restart Apache by giving this command on the command line:sudo /etc/init.d/apache2 restart

(As an alternative to step 2, you can command

)

 

How to enable mod_rewrite in Apache?

To enable it the rewrite module, run “apache2 enable module rewrite”:

You need to restart the webserver to apply the changes:

If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit/etc/apache2/sites-available/default:

 

After such a change, you need to restart Apache again.

Ref: http://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache

Ubuntu – deb command-not-found

While installing New Relic‘s server monitoring on my Ubuntu server. After entering following command given at New Relics installtion instrcutions

I was getting this this error “deb command no found”, after searching for solution on internet I found following answer

Deb is not a command. You need to edit your /etc/apt/sources.list file and add the line

to the end of the file.

Redirect website to https from cpanel or htaccess file or php

If you want to redirect using htaccess, add following lines in the htacess files

We can also redirect  using php code in out header file

To redirect from cPanel,

Log into your websites control panel, then go to “Domains” section. Click on “Redirects” option

– Select type “Permanent (301)” from dropdown menu

– Select domain name which you want to redirect

– And finally enter the url to which you want the above select domain redirect to