Get Social

How to install nginx push-and-pull on Debian (for Bitrix)

So, after the Nginx update on Debian some of the business functions of the portal Bitrix stopped working.
It turned out: the problem is that there was a previos nginx version where the necessary module was compiled manually.

Decision:
1. rebuild fresh nginx with the push-and-pull module (nginx-push-stream-module)
2. configure that it is not updated

Let’s start:

[1] The following sequence of commands makes it clear what to do:

Download Nginx and nginx-push-stream-module sources:
cd /tmp/
apt-get build-dep nginx
apt-get source nginx
mkdir nginx-1.8.1/debian/modules && nginx-1.8.1/debian/modules
wget https://github.com/wandenberg/nginx-push-stream-module/archive/0.4.1.tar.gz

! at the moment, you can not put the module version 0.5 and higher on Bitrix – it will not work, Bitrix developers limited to these versions

Add next under the last “–with-http” in the rules for building the package:
--add-module=/tmp/nginx-1.8.1/debian/modules/nginx-push-stream-module-0.4.1 \

cd ..
nano debian/rules


Compile and install deb package:

dpkg-buildpackage -b
cd ..
dpkg -i nginx_1.8.1-1~wheezy_amd64.deb

[2] Now we need to make the hold on the package – so that we will not update
(for example, go to aptitude and click on the name of the package “=”)

On a note. It is always important for a freelancer or a remote employee to profitably exchange electronic money , for this it is better to use the trusted monitoring of exchange points of electronic currencies

How to install and configure owncloud on debian

As we see in owncloud.org -> install – there are several options for installation – an archive file, a web installer and packages for various systems.

I decided to install the package to be able to put updates and to automatically satisfying the dependencies.
For Debian 7.0, you must first run the following commands (as root, of course):

Добавим ключ репозитория:
wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key
apt-key add - < Release.key

Enable the repository, update the information about the packages and install:
echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list
aptitude update
aptitude install owncloud

(you can use apt-get instead of aptitude)

As I thought – quite a lot of packages were in dependencies, so this is the best way to install ownCloud.

There are a few simple steps left:
1. Go to http://your-server/ownCloud
2. Set a password and login for the administrator
3. It is best to specify the folder when installing, where all the data will be – specifically create such a folder in the right place on the server and make web user the owner of it.

mkdir /home/backup/ownCloudData
chown www-data: /home/backup/ownCloudData

4. It is usually recommended to create a user and database in Mysql. But this is for large installations. In my case, this was necessary for several people, so the sqlite database is sufficient.

5. it’s all!

How to monitor mysql queries

Sometimes, you need to figure out which request comes from cms / cmf or another script to the Mysql server.
For example, I had to deal with the jqgrid-php library. It was unclear which query comes to the mysql server from the script.

You can, of course, install and configure mysql-proxy, but there is a simpler solution:

1. Login to Mysql-server as mysql admin (root) user.

2. Set where to write the log:
set global general_log_file='/tmp/mysql_query.log';

3. Enable log:
set global general_log = 1;

4. Run your scripts

5. Turn it off so it does not clog the server
set global general_log = 0;

6. Analyze the log:
less /tmp/mysql_query.log

7. it’s all!