Category «Ubuntu Server Configuration»

Redirect www to non-www on Nginx

How to redirect the www.domain.com version of your website to domain.com version on Nginx? Here is how. You basically have to make two server blocks. The block with your normal configuration should be the version you want, the version you want to redirect should have a simple rewrite rule alone. For example, to redirect www.vidyut.net …

Fix a broken mysql

If your mysql seems broken and giving errors like: # service mysql start start: Job failed to start or ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) Or if you try to recreate databases with mysqlinstalldb: … … ERROR: 1 Can’t create/write to file ‘./mysql/db.frm’ (Errcode: 13) 041226 xx:xx:xx /usr/libexec/mysqld: …

bash: add-apt-repository: command not found

If you are trying to add a ppa repository and get the following error bash: add-apt-repository: command not found You need to install python-software-properties, like so apt-get install python-software-properties If you have python-software-properties installed and are still getting this error, there is some problem with the package. Uninstall and reinstall it. apt-get remove python-software-properties –purge …

WordPress: Problem happened with plugin upgrade – can’t delete old files

When you get an error like this while updating, check file ownership. Chances are that you edited something in the backend and the plugin or theme files now being owned by another user, cannot be deleted by the server. If you have terminal access as root, type: chown -R www-data:www-data /path/to/wordpress/* Where www-data is the …