...
Just my blog

Blog about everything, mostly about tech stuff I made. Here is the list of stuff I'm using at my blog. Feel free to ask me about implementations.

Soft I recommend
Py lib I recommend

I'm using these libraries so you can ask me about them.

php upgrade Centos 6

Bookmarked

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

 

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

 

# yum --enablerepo=remi,remi-test install httpd php php-common

 

# yum --enablerepo=remi,remi-test install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

  http://serverfault.com/questions/466394/how-to-upgrade-php-to-5-4-10-on-centos-6-3 https://webtatic.com/packages/php54/ http://superuser.com/questions/615401/upgrading-php-5-3-3-to-5-4-4-in-centos-6-4

Read...

Y.A. great plugin for Redmine!

Yet another great plugin for Redmine just teached me how to add tables and columns manually into MySQL db. mysql-redmine This is "nice" plugin: Issue Templates Have a great issue: error 500 And YES it have been migrated!

root@tet-redmine www/redmine# rake redmine:plugins:migrate RAILS_ENV=production
Migrating hooks_manager (Hooks manager)...
Migrating redmine_ckeditor (Redmine CKEditor plugin)...
Migrating redmine_digest (Digest plugin)...
Migrating redmine_issue_checklist (Redmine Issue Checklist plugin)...
Migrating redmine_issue_templates (Redmine Issue Templates plugin)...
Migrating redmine_lightbox (Redmine Light Box plugin)...
Migrating redmine_omniauth_ulogin (Redmine Omniauth uLogin plugin)...
Migrating redmine_open_links_in_new_window (Redmine Open Links In New Window plugin)...
Migrating redmine_people (Redmine People plugin)...
Migrating sidebar_hide (Sidebar Hide Plugin)...

But did not works! And I spent about 3hrs of my sleeping to find a roocause. You can see picrelated - Ive added those tables - manyally! How to figureout this issue see the production.log

Completed 500 Internal Server Error in 4.7ms ActiveRecord::StatementInvalid(Mysql2::Error: Table 'redmine_production.global_issue_templates' doesn't exist: SHOW FULL FIELDS FROM `global_issue_templates`):
  • be sure …

Read...

Webmin SSL disable

Как выключить SSL  в вебмине:

/etc/webmin/miniserf.conf
ssl=0
~service webmin restart

Read...

How to Serve Multiple Domains Using Virtual Hosts

Снова себе напоминалка себе, забыл про вирт. хосты. На мульти доменном сервере всегда нужно делать разводку по именам виртуальных хостов, вот код, чтобы не забыть: NameVirtualHost *:80

 VirtualHost *:80
  ServerName vh1.example.com
  DocumentRoot /var/www/vhosts/vh1
/VirtualHost
 
VirtualHost *:80
  ServerName vh2.example.com
  DocumentRoot /var/www/vhosts/vh2
/VirtualHost

Источник: How to Serve Multiple Domains Using Virtual Hosts | Knowledge Center | Rackspace Hosting.

Read...

MySQL troubleshooting

Возможные проблемы:

  •  отваливается сокет /var/lib/musql/mysql.sock

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Лечится при помощи проверки прав на папку в директории: Проверяем:

[root@web-server ~]# cd /var/lib/mysql
[root@web-server mysql]# ls -l

Ставим: chown -R :mysql /var/lib/mysql -R - все вложенные, получат такие же права

drwx------. 2 mysql mysql 4096 Oct 31 07:32 mysql
srwxrwxrwx. 1 mysql mysql 0 Nov 8 19:41 mysql.sock
drwx------. 2 mysql mysql 4096 Nov 4 15:38 radio_tk_def
  • не стартует служба mysqld

[root@web-server mysql]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]

Проверим, все ли нормально с конфигами /etc/my.cnf Самая простая и рабочая конфига:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client] …

Read...

Centos умирает от winbind

Сегодня "уронил" свой веб сервер неправильной настройкой samba+krb5+winbind. Траблшут под руководством товарища показал, что я, по своей навности отдал системе предпочтение использовать хранилищем базы аккаунтов и паролей виндовый хост, к которому, собственно веб-сервер так и не был подключен. При старте системы, ничто не могло запуститься, так как не имело прав, вообще. Краеугольный камень: /etc/nsswitch.conf читать здесь: http://linux.die.net/man/5/nsswitch.conf и здесь: http://www.faqs.org/docs/securing/chap6sec71.html Способ лечения: - запуститься изпод лайв-сиди, найти указанный выше конфиг и исправить его

Как должно все выглядеть:

The /etc/nsswitch.conf file is used to configure which services are to be used to determine information such as hostnames, password files, and group files. The last two ones, password files, and group files in our case are not used, since we don't use NIS services on our server. Thus, we will focus on the hosts line in this file.

Edit the nsswitch.conf file vi /etc/nsswitch.conf and change the hosts line to read:

          "hosts:      dns files"

Which …

Read...