# Remove index.php$ if ($request_uri ~* “^(.*/)index\.php$”) { return 301 $1; } location / { try_files $uri $uri/ /index.php?$args; # Remove from everywhere index.php if ($request_uri ~* “^(.*/)index\.php(/?)(.*)”) { return 301 $1$3; } } Ayrıca eğer double slash ve trailing slash karakterlerini de kaldırmak isterseniz şu kodları ekleyebilirsiniz: # Remove trailing slash. if (!-d $request_filename) […]
Category: Linux
Apache Server Enable Deflate
# BEGIN Enable Compression <IfModule mod_deflate.c> # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType […]
Apache Server Enable Browser Caching
# BEGIN Browser Caching <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/css “access plus 1 month” ExpiresByType text/javascript “access plus 1 month” ExpiresByType text/html “access plus 1 month” ExpiresByType application/javascript “access plus 1 month” ExpiresByType application/x-javascript “access plus 1 month” ExpiresByType application/xhtml-xml “access plus 1 month” ExpiresByType image/gif “access plus 1 month” ExpiresByType image/jpeg “access plus 1 […]
Apache Server Enable GZIP
# BEGIN Enable GZIP <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </IfModule> # END Enable GZIP
Ubuntu’da Virtual Host Tanımlamak
Aşağıdaki klasörü oluşturun; sudo mkdir -p /var/www/test.com/html Aşağıdaki kodla oluşturduğunuz dizine kullanıcı haklarını verin; sudo chown -R $USER:$USER /var/www/test.com/html/ Aşağıdaki kodla dizinin yazma izinlerini değiştirin; sudo chmod -R 755 /var/www/test.com/html Aşağıdaki kod yardımıyla dizine ait config’ler tanımlayacağınız dosyayı oluşturun; sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/test.com.conf Oluşturduğunuz config dosyasına aşağıdaki kodları girin; <VirtualHost *:80> ServerName test.com ServerAlias www.test.com […]
NginX User Agent Bloklama
map $http_user_agent $limit_bots { default 0; ~*(google|bing|yandex|msnbot) 1; ~*(AltaVista|Googlebot|Slurp|BlackWidow|Bot|ChinaClaw|Custo|DISCo|Download|Demon|eCatch|EirGrabber|EmailSiphon|EmailWolf|SuperHTTP|Surfbot|WebWhacker) 1; ~*(Express|WebPictures|ExtractorPro|EyeNetIE|FlashGet|GetRight|GetWeb!|Go!Zilla|Go-Ahead-Got-It|GrabNet|Grafula|HMView|Go!Zilla|Go-Ahead-Got-It) 1; ~*(rafula|HMView|HTTrack|Stripper|Sucker|Indy|InterGET|Ninja|JetCar|Spider|larbin|LeechFTP|Downloader|tool|Navroad|NearSite|NetAnts|tAkeOut|WWWOFFLE) 1; ~*(GrabNet|NetSpider|Vampire|NetZIP|Octopus|Offline|PageGrabber|Foto|pavuk|pcBrowser|RealDownload|ReGet|SiteSnagger|SmartDownload|SuperBot|WebSpider) 1; ~*(Teleport|VoidEYE|Collector|WebAuto|WebCopier|WebFetch|WebGo|WebLeacher|WebReaper|WebSauger|eXtractor|Quester|WebStripper|WebZIP|Wget|Widow|Zeus) 1; ~*(Twengabot|htmlparser|libwww|Python|perl|urllib|scan|Curl|email|PycURL|Pyth|PyQ|WebCollector|WebCopy|webcraw) 1; } location / { if ($limit_bots = 1) { return 403; } }
.htaccess’ten nginx config’ine Rewrite Rule Dönüşümü
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9_-]+)-kasko-sigortasi$ /arac-kasko/index.php?arac=$1 RewriteRule ^([a-zA-Z0-9_-]+)-kasko-sigortasi/$ /arac-kasko/index.php?arac=$1 location / { rewrite “^/([a-zA-Z0-9_-]+)-kasko-sigortasi$” /arac-kasko/index.php?arac=$1; rewrite “^/([a-zA-Z0-9_-]+)-kasko-sigortasi/$” /arac-kasko/index.php?arac=$1; }
Ubuntu – RabbitMQ Kurulumu
sudo apt-get install erlang sudo add-apt-repository “deb http://www.rabbitmq.com/debian/ testing main” wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc sudo apt-key add rabbitmq-signing-key-public.asc sudo apt-get update sudo apt-get install rabbitmq-server sudo rabbitmqctl status sudo rabbitmqctl start sudo rabbitmqctl stop sudo rabbitmq-plugins enable rabbitmq_management localhost:15672 username: guest password: guest
Çalışan Process Sayısı
/bin/ps aux | grep -i [*ProcessName*] | grep -v grep | wc -l
CentOS 6 Git Kurulumu
wget http://git-core.googlecode.com/files/git-1.8.3.4.tar.gz yum install zlib-devel perl-CPAN gettext gcc tar xvfz git-1.8.3.4.tar.gz cd git-1.8.3.4 ./configure make make prefix=/usr install git –version Kullanımı: git clone git://github.com/link