Category Archives: Linux

Install Plesk in CentOS

I’m installing a Plesk on a virtual machine, in a fresh CentOS.

For non-fresh CentOS  or with f Apache, PHP, MySQL and/or Cyrus, remove them.

yum remove http* 
yum remove php* 
yum remove cyrus* 
yum remove mysql*

1. Disable SELinux status

setenforce 0

3. Make a working directory and go inside her 😉

mkdir /root/plesk
cd /root/plesk

4. Download the plesk auto installer

wget http://autoinstall.plesk.com/plesk-installer

5. Run it

 sh ./plesk-installer

Now is just follow the screens! 🙂

 Congratulations!
 All stages of the installation/upgrade have been finished.
 psa is now running on your system.
 To complete the system configuration process, please proceed to URL:
 https://localhost.localdomain:8443/ or
 https://127.0.0.1:8443/
 Use 'root' and '<YOUR root PASSWORD>' as login name and password in case of fresh installation.
 Use 'admin' and '<YOUR admin PASSWORD>' as login name and password in case of upgrade,
 or if Plesk is already configured.

Further, use the following commands to start and stop the system:
 /etc/init.d/psa start and
 /etc/init.d/psa stop respectively.

 

Your host name must resolve to the correct IP address of your server – Plesk

Your host name must resolve to the correct IP address of your server, unless you are using network address translation (NAT).

Please quit Parallels Installer, fix the host name resolution problem,
and then try installing again.
You can skip the hostname check and continue the installation, however,
in such a case, the installer cannot guarantee successful installation.

I’v edited /etc/hosts/ and added

127.0.0.1 webhostplesk 

to it.
It worked… dunno if is the right solution, but it worked. 🙂

 

GoAccess – analyzer and interactive viewer of apache or nginx logs

GoAccess is an open source real-time Apache log analyzer and interactive viewer that runs in a terminal in *nix systems. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly.

All credits go to http://www.ubuntugeek.com/goaccess-visual-apachenginx-log-analyzer.html

Continue reading GoAccess – analyzer and interactive viewer of apache or nginx logs

cronjob – emails to /dev/null or /dev/null 2>&1

We can send the output of our cron jobs to /dev/null, but this way error and other debug messages aren’t lost and we will be notified when the occur!

If you don’t want to receive them add  2>&1 to it.

* * * * * /bin/ping -c 10 www.digitalwhores.net > /dev/null 2>&1 – no emails will be sent
* * * * * /bin/ping -c 10 www.digitalwhores.net > /dev/null – error and debug messages will be sent.

Peace.

nignx timeouts

Some tweaks to avoid times out on nginx/php.

Add the following lines to your nginx.conf  (mine is /etc/nginx/nginx.conf) inside http { 

client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
client_max_body_size 32m;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;

Lets hope it solves it…

Linux add user and change its home dir

I usually need to create Linux users for FTP access…
FTP is unsecure, we should use sftp bla bla blaa…

Add user
useradd username
Set/change password
passwd username
Set user’s home dir
usermod -m -d /new/path/ username

This way we will set the new path (/new/path/) to the user named username.

-m defines that content from the old home directory will be mobed to the new one.
-d the new home dir’s path

 See user’s information
finger username

 

 

ionCube loader on Ubuntu 13.10 64bits with PHP-FPM and nginx

rock ssd

Site error: the file /data/httpd/domain.com/public_html/application/controllers/frontpage.php requires the ionCube PHP Loader ioncube_loader_lin_5.6.so to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.

1. Download the following archives of Loaders for Linux x86-64
cd /usr/local
sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz

 

2. Copy or move the Loader files

PHP modules’ folder can be found using

php -i | grep extension_dir

Example of an output
Example of an output 

mv /usr/local/ioncube/* /usr/lib/php/20151012/

A nice article of how set up a backup of your website with rysnc and centos 6

This article provides a quick way to backup the most common things in a typical web hosting scenario: website files and database data. We will setup a full daily backup of a website folder and a copying of this data to a remote server (this can also work for another VPS). We will also set up a rsync example to just copy the incremental changes. Finally, we’ll set up backup of a MySQL database. The procedures described use a few simple Bash commands, rsync and cron to schedule backups. For example data, we can install WordPress as per this tutorial. It will place WordPress in /var/www/wordpress directory and a MySQL database wordpress and we now want to take a backup of all the data.

Read more at: https://www.digitalocean.com/community/articles/how-to-create-an-off-site-backup-of-your-site-with-rsync-on-centos-6

HOORAY! for Digital Ocean!

Call to undefined function json_decode()

My

tail -f /var/log/nginx/error.log

was getting me  the following error

2013/11/19 20:07:59 [error] 5561#0: *192 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function json_decode() in /home/webroot/domain.net/www/index.php on line 36" while reading response header from upstream, client: 84.91.4.220, server: domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.domain.net"

Simple solution

sudo apt-get install php5-json

and then restart php5-fpm

sudo service php5-fpm restart