[РЕШЕНО] CMS и VPS для начинающих Е-предпринимателей

palpalych
А кто подскажет для установки nginx откуда начинать вникать в эту Вику? больно она муторная…
Ниоткуда.
Ставьте пакет nginx, делайте
systemctl enable nginx
systemctl start nginx
а потом читайте оригинальный ман на русском языке:
http://nginx.org/ru/docs/
Natrio
Ниоткуда.
Класс. Да спасибо. Разобрался.
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
corner
Лучше перейдите на TCP
с удовольствием, подскажите как это сделать?

corner
Попробуйте так
Так не работает

Народ направьте, что не так, взял из корня .htaccess
AddDefaultCharset UTF-8

Options +FollowSymLinks
Options -Indexes

RewriteEngine on

# RewriteCond %{HTTP_HOST} ^index.php/$1 [NC]
# RewriteRule ^(.*)$ http://site.com/$1 [L,R=301]

#apache2ctl -M && sudo a2enmod expires && sudo service apache2 restart (to enable mod_expires on ubuntu)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
ExpiresByType application/javascript "access 1 year"
ExpiresByType application/x-javascript "access 1 year"
ExpiresByType text/css "access 1 year"
ExpiresByType text/html "access 1 year"
</IfModule>

RewriteRule ^(.*)\.tpl$ [R=404]
RewriteRule ^(.*)\.zip$ [R=404]

RewriteCond $1 !^(index\.php|user_guide|uploads/.*|favicon\.ico|docs|favicon\.png|captcha/.*|application/modules/.*/templates|application/modules/.*/assets/js|application/modules/.*/assets/css|application/modules/.*/assets/images|CHANGELOG.xml|templates|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

####################################
# or
# RewriteRule ^(.+)$ index.php?$1 [L]
# or
# RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]
сунул его сюда вроде должно работать, а не работает
#user http;
worker_processes  4;
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
    #access_log  logs/access.log  main;
    sendfile        on;
    keepalive_timeout  15;
    gzip  on;
    gzip_comp_level 1;

    server {
        listen 127.0.0.1;
        server_name  localhost;

        location ~ \.php$ {
            root /srv/http;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location /phpmyadmin {
            rewrite ^/* /phpMyAdmin last;
        }
        location / {
            root /srv/http;
            index index.php;
        }
    }

    server {
        listen 127.0.0.2;
        server_name exp.loc;
        access_log /var/log/nginx/exp.loc.log;

        location / {
            root /home/archie/Projects/www/exp.loc;
            index index.htm index.html index.php;
            charset utf-8;
            autoindex off;
            rewrite ^/(.*)\.tpl$ / redirect;
            rewrite ^/(.*)\.zip$ / redirect;
            rewrite ^(.*)$ /index.php/$1 break;
        }
        location ~ \.(tpl|ini|log)
        {
            deny all;
        }
    }

    server {
        listen 127.0.0.3;
        server_name opencart;
        access_log /var/log/nginx/opencart.log;

        location ~ .*\.(ico|gif|jpg|jpeg|png|js|css) {
        }
        location = /sitemap.xml {
            rewrite ^(.*)$ /index.php?route=feed/google_sitemap break;
        }
        location = /googlebase.xml {
            rewrite ^(.*)$ /index.php?route=feed/google_base break;
        }
        location /download {
            rewrite ^/download/(.*) /index.php?route=error/not_found break;
        }
        location / {
            root /home/archie/Projects/www/opencart;
            index index.htm index.html index.php;
            charset utf-8;
            autoindex off;
            if (!-e $request_filename){
            rewrite ^/([^?]*) /index.php?_route_=$1 break;
            }
        }
        location ~ \.(tpl|ini|log)
        {
            deny all;
        }
    }
}
На запрос:
localhost (127.0.0.1) и opencart (127.0.0.3) и exp.loc - появляется окошко загрузки файла "загруженное"
127.0.0.2 - 404 Not Found
localhost/index.php и localhost/phpMyAdmin/ - соответственно работают как надо.
/etc/hosts
127.0.0.1	linux	localhost
127.0.0.2	exp.loc
127.0.0.3	opencart
::1		linux	localhost
Перечитал уже все что можно
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
Люди выручайте, ну дайте наводку, кто-нибудь!!!
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
вот наводка:
default_type  application/octet-stream;
такие дела.
cucullus
default_type application/octet-stream;
Если Вы это имели в виду
application/octet-stream              php;
то не работает.
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
Ошибка была в том что вот этот код
location ~ \.php$ {
            root /srv/http;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
Нужно дублировать в каждом виртуальном хосте
Тем не менее вот что есть на текущий момент
server {
        listen 80;
        server_name  localhost;

        location ~ \.php$ {
            root /srv/http;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location /phpmyadmin {
            rewrite ^/* /phpMyAdmin last;
        }
        location / {
            root /srv/http;
            index index.php;
        }
    }

    server {
        server_name exp.loc;
        index index.htm index.html index.php;
        access_log /var/log/nginx/exp.loc/access.log;
        error_log  /var/log/nginx/exp.loc/error.log;

        listen 127.0.0.2:8080;
        charset utf-8;
        autoindex off;

        location ~ \.php$ {
            root /home/archie/Projects/www/exp.loc;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location / {
            root /home/archie/Projects/www/exp.loc;
            if (!-e $request_filename) {
            rewrite ^(.+)$ /index.php?q=$1 last;
            }
        }
    }
    server {
        server_name exp;
        index index.htm index.html index.php;
        access_log /var/log/nginx/exp/access.log;
        error_log  /var/log/nginx/exp/error.log;

        listen 127.0.0.3:8080;
        charset utf-8;
        autoindex off;

        location ~ \.php$ {
            root /home/archie/Projects/www/exp;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location / {
            root /home/archie/Projects/www/exp;
            if (!-e $request_filename) {
            rewrite ^(.+)$ /index.php?q=$1 last;
            }
        }
    }
}
какая-то мистика, страница открывается только при указании :8080, без этого открывается путь /srv/http, т.е. index.php, если-же пытаться, как с апачем, указывать server_name exp.loc то появляется загрузка какой-то хрени под названием "загруженное"
Я понимаю что вопросы в высшей степени нубовские, кому-то покажутся, но когда заходишь в яндекс, складывается такое ощущение что инфу подают для профи, для чайников нет ни хрена.

п.с. щас нашел т.н. Виртуальный хостинг на сайте - и есть ли смысл?
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
короче чтобы на локалке корректно работал виртуальный хост пришлось конфиг привести к такому виду,
что-бы сайт открывался не только по ip (127.0.0.1) а и по url (exp.ru)
и второе - переход на любую ссылку на сайте все равно дает в адресной строке ip адрес (127.0.0.1:9000/…), вместо url (exp.ru/…), почему, кто знает?
http {
    include       mime.types;
    default_type  application/octet-stream;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
    #access_log  logs/access.log  main;
    sendfile        on;
    keepalive_timeout  15;
    gzip  on;
    gzip_comp_level 1;

    server {
        listen 80;
        server_name localhost;

        location ~ \.php$ {
            root /srv/http;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location /phpmyadmin {
            rewrite ^/* /phpMyAdmin last;
        }
        location / {
            root /srv/http;
            index index.php;
        }
    }
    server {
        server_name exp.ru;
        index index.htm index.html index.php;
        access_log /var/log/nginx/exp/access.log;
        error_log  /var/log/nginx/exp/error.log;

        listen exp.ru;
        listen 127.0.0.2:9000;

        charset utf-8;
        autoindex off;

        location ~ \.php$ {
            root /home/archie/Projects/www/exp.ru;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location / {
            root /home/archie/Projects/www/exp.ru;
            if (!-e $request_filename) {
            rewrite ^(.+)$ /index.php?q=$1 last;
            }
        }
    }
    server {
        server_name work.ru;
        index index.htm index.html index.php;
        access_log /var/log/nginx/work/access.log;
        error_log  /var/log/nginx/work/error.log;

        listen work.ru;
        listen 127.0.0.3:9000;

        charset utf-8;
        autoindex off;

        location ~ \.php$ {
            root /home/archie/Projects/www/work.ru;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
        location / {
            root /home/archie/Projects/www/work.ru;
            if (!-e $request_filename) {
            rewrite ^(.+)$ /index.php?q=$1 last;
            }
        }
    }
}
Может кто-то оценить на корректность? Может там глупости?
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
lavlan
ARCH Linux, пожалуй на нем и остановлюсь….
А где хоститесь? Нашел вот это, дешево и сердито, только положительные отзывы…
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
palpalych
переход на любую ссылку на сайте все равно дает в адресной строке ip адрес (127.0.0.1:9000/...), вместо url (exp.ru/...), почему, кто знает?
Мистика, то ли после обновления, короче щас url нормально работает.

Люди ну оживите топик, подскажите имеет ли смысл на VDS ставить Арч с гномом или в консоли остаться и какую конфигурацию хостинга выбрать?
И еще вопрос, у них SSD, есть отличия от обычной установки Арча на HDD?
Арчи ~]$ ...as always want ready-made solutions that would make even tastier
 
Зарегистрироваться или войдите чтобы оставить сообщение.