[EN] How make propre domeniu.com

Ghiduri şi tutoriale despre cum să vă îmbunătăţiţi serverul/clientul dv. de metin2.
Avatar utilizator
Nivel 1
Nivel 1
Mesaje: 136
Membru din: 29 Noi 2013
Localitate: HuneDoara
Status: Happy
Mulțumiri acordate: 0
Mulțumiri primite: 0

[EN] How make propre domeniu.com

Mesajde K3nnTHD » 30 Dec 2014, 10:26

Hi j4m!

Install nginx:
cd /usr/ports/www/nginx
make install clean

Make sure these are selected with space bar:
[X] HTTP_MODULE Enable HTTP module
[X] HTTP_ADDITION_MODULE Enable http_addition module
[X] HTTP_CACHE_MODULE Enable http_cache module
[X] HTTP_GEOIP_MODULE Enable http_geoip module
[X] HTTP_GZIP_STATIC_MODULE Enable http_gzip_static module
[X] HTTP_IMAGE_FILTER_MODULE Enable http_image_filter module
[x] HTTP_PERL_MODULE Enable http_perl module
[X] HTTP_REALIP_MODULE Enable http_realip module
[X] HTTP_REWRITE_MODULE Enable http_rewrite module
[X] HTTP_STATUS_MODULE Enable http_stub_status module
Press "Enter" when ready to continue.

Install libtool
cd /usr/ports/devel/libtool
make install clean

Install php5
cd /usr/ports/lang/php5
make config
Make sure the following is selected with space bar then press "Enter":
[X] FPM Build FPM version (experimental)
Leave everything else default.

then do this:
make install clean

If you need cURL support then do this, if not then skip this step:
cd /usr/ports/lang/php5-extensions
make config
Make sure that the "CURL Support" is selected then press "Enter".

Then do the installation and clean the directory:
make -DBATCH install clean

Time to configure your php.ini file...

cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
Edit /usr/local/etc/php.ini in WinSCP using Notepad++. Firstly, set your "date.timezone" to the appropriate one. Choose from this list: Trebuie să fii logat sau înregistrat pentru a vedea acest link.

Next, if you have something that needs to run large MYSQL queries you may run into some issues. Some website packages also can cause these problems. The issue is with memory usage. For security reasons there are limitations set on how much memory php is allowed to use. I suggest only modifying this IF you have problems loading memory-intensive pages. Just try to raise it a bit until it works, don't raise it to an excessively high number. I had to set mine to "512M" to make my queries work in my patcher. It can be set by just inputting numbers and they will be recognized as bytes, or you could use K, M, or G.
memory_limit = 512M

Installation of php-mysql5:
cd /usr/ports/databases/php5-mysql
make -DBATCH install clean

If you've gotten this far, congratulations.. you're almost done!

You need to create a folder for your website like this:
mkdir /usr/local/www/nginx/domain.com
Set the owner and permissions:
chown www:www /usr/local/www/nginx/domain.com
chmod 755 /usr/local/www/nginx/domain.com

Customize this file to your needs and upload it to /usr/local/etc/nginx:

user www;
worker_processes 2;

events {
worker_connections 1024;
multi_accept on;

worker_rlimit_nofile 20000;

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 10;
client_max_body_size 64M;
server_tokens off;
client_body_buffer_size 128k;
keepalive_requests 10000;
reset_timedout_connection on;
send_timeout 5;
open_file_cache max=20000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
directio 50m;

server {
listen 80;
server_name Trebuie să fii logat sau înregistrat pentru a vedea acest link.
rewrite ^(.*)$ $scheme://patch.mysite.com$1;

server {
types {
application/octet-stream lz;
text/plain xml;
text/css css;

listen 80;
server_name patch.mysite.com;
root /usr/local/www/nginx/patch.mysite.com;
rewrite ^/$ /index.php permanent;
index index.php;

location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 7d;

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

location ~ /\. {
deny all;


If you're using cloudflare, uncomment the lines 38-57 by removing the "#". The reason for this is to ensure you get the real user IP in your logs rather than cloudflare's IP.

If you want to allow directory listing.. ie: [url=http://domain.com/fi...main.com/files to present a visitor with a list of files they can access/download then uncomment lines 63 and 73.

You MUST change the domain name to your own!

Now you need to enable startup of php-fpm and nginx whenever your server is booted:
ee /etc/rc.conf
Add these lines:
Start your services:
service php-fpm start
service nginx start
Upload your website files to /usr/local/www/nginx/domain.com

"domain.com" reply for exp"metin2.com"

Avatar utilizator
Mister Just4Metin
Mister Just4Metin
Mesaje: 673
Membru din: 28 Sep 2014
Localitate: Targoviste
Status: Sunt bine mersi ^.^
Server Metin2: Metin2Delphi
Regat: Jinno
Mulțumiri acordate: 1
Mulțumiri primite: 2

Re: [EN] How make propre domeniu.com

Mesajde C.Marius » 11 Feb 2015, 11:29

A incercat cineva?

Înapoi la “Ghiduri şi Tutoriale”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: aforic1, andyboss24, K3nTisBack, sorinell și 2 vizitatori