r00t.gr

Programming and more

Entries for April, 2011

Install json (and pcre) for php (CentOS Linux 5.5)

Today I tried to run a script that was using json and got the following error: Fatal error: Call to undefined function json_encode()Fatal error: Call to undefined function json_encode() The problem was that the json library wasn’t installed. I researched google a little and I found how to install it and configure php to use […]

How to change user’s folder in linux (Ubuntu, CentOS, all unix)

To change the default user directory in linux, you have to run: usermod -d /path/to/new/homedir/ usernameusermod -d /path/to/new/homedir/ username You have to run this as root. If you don’t have root access, you can do that: Login with the user you want to change the folder. Then edit .bashrc file: vi ~/.bashrcvi ~/.bashrc And add […]

Find replace in vi or vimfind replace in vi or vim

Vi is a linux text editor. Great REALLY OLD computer users, from the time that there weren’t any GUIS and those you can read and memorize an entire manual. They say (and i think it’s true) that is really fast and practical when you learn ALL the commands and their syntax, but the only way […]

Nginx error: [alert]: mmap(MAP_ANON|MAP_SHARED, 1048576000) failed (28: No space left on device)Nginx error: [alert]: mmap(MAP_ANON|MAP_SHARED, 1048576000) failed (28: No space left on device)

The full error is: Starting nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok [alert]: mmap(MAP_ANON|MAP_SHARED, 1048576000) failed (28: No space left on device) configuration file /usr/local/nginx/conf/nginx.conf test failedStarting nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok [alert]: mmap(MAP_ANON|MAP_SHARED, 1048576000) failed (28: No space left on device) configuration file /usr/local/nginx/conf/nginx.conf test failed This error is related […]

OpenVZ VPS and ip from another subnet

I didn’t know that one and like many great things i learned it from one of my ISP’s. When you have OpenVZ and an ip from another subnet, you can use it, but you have to make a change in openvz configuration for everything to work fine. So the fix is: vi /etc/vz/vz.confvi /etc/vz/vz.conf Find […]

Installing nginx 1.0.0, php, mysql, ftp, disk + memory (ram) caching On Centos 5.5

This is how you install a complete website with nginx php mysql ftp for CentOS. If you have basic linux knowledge you have what it takes to configure a system. Don’t spend you money in expensive Control Panels (Cpanel DirectAdmin) (like i did!). These packages make everything look harder because you didn’t install the packages […]

Installing nginx 1.0.0 On a fresh Centos 5.5 System from source

[I wrote this, and then i found rpm for nginx 1.0.0 see the whole article to setup a complete CentOS system with nginx + php +mysql + eaccelerator + ftp + php caching here: http://www.r00t.gr/2011/04/installing-nginx-php-mysql-ftp-disk-memory-ram-caching-on-centos-5-5/] After my little adventure where i tried to install a complete nginx, php, eaccelerator, mysql, ftp, file + memory php […]

How to fix: PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0

I setup an Ubuntu system with nginx and php, but i noticed a strange error. Every time i run something php related in the console i get this strange error: PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0PHP Deprecated: Comments starting with ‘#’ are deprecated […]

Easy way to install and configure ftp server support for Ubuntu linux

This the last chapter so far, for installing and configuring a fresh Ubuntu system for web use. We discussed and used so far nginx, mysql, php, eaccelerator (this program automatically compiles php files to run faster), and we I helped you use the excelent nginx php file caching feature and how to convert that file […]

Install nginx v1.0.0 + php + eaccelerator + mysql + ftp + file and memory caching on an Ubuntu 10.04 System

I am designing at the moment a new website. I don’t want to reveal much, but i except this to have much traffic, and there will be a lot of php running in the background, and the site will use a very large database, and a remote API. So it is very important that i […]