This tutorial provides an example of Apache Active Directory Authentication using the Authz LDAP module.
Apache and SSL settings are not in the scope of this tutorial.
If you’re here, you’re probably knows what `Kafka` is and what it should be used for.
If not, visit Apache Kafka page to learn more
First thing, lets go over to Kafka Download page to download kafka into our machine:
# choose a directory to download kafka into. it could be really anywhere:
# /home, /var, /usr, /opt or even /tmp if you just wanna play with it.
tar -zxvf kafka_2.10-0.8.2.0.tgz
rm kafka_2.10-0.8.2.0.tgz -y
Well.. and that’s preety it. you have Kafka CentOS installation on your machine. Now, lets play with it a little:
from Kafka QuickStart:
Kafka uses ZooKeeper so you need to first start a ZooKeeper server if you don’t already have one. You can use the convenience script packaged with kafka to get a quick-and-dirty single-node ZooKeeper instance.
so just run now at your console:
after, you’ll see the BEAUTIFUL output telling you everything is fine and zookeeper is running on 0.0.0.0:2181:
Now, we’re gonna be more dirtier and just for now, we’ll move the zookeeper server into background so we could start the kafka server. This can be done by pressing: CTRL+Z which outputs:
+ Stopped bin/zookeeper-server-start.sh config/zookeeper.properties
Then run the command:
> + bin/zookeeper-server-start.sh config/zookeeper.properties &
# you can check that zookeeper is running at background by use the jobs command:
> + Running bin/zookeeper-server-start.sh config/zookeeper.properties &
Now start the Kafka server:
And look as the PRETTY lines are printing and loading your Kafka server instance.
If you get this error, you need to add your hostname to /etc/hosts: 127.0.0.1 localhost myhostname
That’s it, you have Kafka CentOS installation! Go from STEP 3 in the quickstart to learn the basics of Kafka..
How to speed up website load time is important question for those that performance matters to them.
Nobody Likes a Slow Website!
How to speed up website?
Website optimization is a required step for production, and when is automated when possible correctly it can help you deliver your website as fastest as possible without compromising on development comfortability and code readability.
How to speed up website question could be answered for your case better if you’ll use a website speed test tools. There several good websites load time speed tests available online for free. check out pingdom website speed test, Google PageSpeed tools. this are very good tools which also gives you important and valuable information and tips to speed up your website.
Some of them rates your website and/or explain what could be done to make your site faster. you can learn also a lot from loading time graphs.collect information from all the above to optimize your website to maximum.
if your score is bad.. continue reading How to speed up website
How to speed up website load time
So, how to speed up your website load time?
You can do that using several tweaks.. one at a time…
Use the mentioned websites speed test graphs to learn what are the slowest parts of your website and start with them. does the problem is with your webserver or maybe the infrastructure?
How to speed up website ? Does your static files load time is the problem?
And maybe it is the dns? processing request? loading the images? loading the scripts? maybe you have bad requests?
This extreme powerfull tool will help you learn your weaks and strongs.
If your website on load check if it’s mobile or not, then it redirect to another page when checks the language and then redirects to another page who check the cookies and then redirect… well you’ve got the idea. Bad design pattern!
Set up your server to return Expire and Cache-Control headers with static files. Setup you expire date to be within week or more is a very good timeframe (depend on how frequently you update your website static files you can setup the expire date as required).
A Content Delivery Network (CDN) can be an important tool in achieving decent page load and web application speeds. Providers such as Akamai, EdgeCast, Amazon (CloudFront), Rackspace (CloudFiles), Google (PageSpeed) and Microsoft (Azure CDN) are providing the means to distribute your content to locations geographically closer to your customers/users, which improves the responsiveness of the application or website.
Although using a CDN can help with page load speeds, a CDN is not always the best solution in terms of Cost–benefit.
when configuring a cache server before your website server, and no matter if it’s apache, tomcat, gunicorn or any other html generator you can boost up clients page load dramatically.
caching the compiled html pages is very important speed tweak. if you have any static and/or low-rate updated pages with no problem if some users will not see the lastest updates of the html when it changes (until cache reloads).. check varnish-cache or squid-cache or nginx (with HttpProxy module) or Apache with mod_proxy.
You should think of your webapp as in several seperate layers. where one layer could answering html requests and other serving your static files. always try to find the suitable tool for this mission in terms of speed (and taste). consider serving your static files (those not on CDN) using the fastest web server for static files you can find.
A very important stage is to minify data.
Configure you webserver (nginx, apache,etc) to GZip response.
Set the Vary header (Vary: Accept-Encoding header) correctly for Internet Explorer.
If you have data you can cache in memory for your application server – DO IT.
It can be small data (like the number of your followers you’ve just counted from facebook, twitter and youtube JSON calls) or the Entire processed HTML.
Put expire time for each resource on your store as needed.
‘ How to speed up website ‘ tutorial ends here.
hope you’ll have fun optimizing your website and now you now few important tips on How to speed up website
Using those steps I’ve managed to reduced my website load time from several seconds to only 1-2 seconds (and sometimes less then second). It’s was worth the effort!!
Good day (or night),
Apache Variables are not supported by defaultby apache but you can do two things to achieve this functionality::
This article was written with instructions for Centos 6.x, but the concept applies any distibution.
To set environment variables in your Apache init script (/etc/init.d/httpd) before the line that calls httpd. For example, add:
Better would be to store all the variables in an external file, for example you can call it: /etc/httpd/conf/vars.txt and add to it all your variables:
and then include these into your Apache init.d script with:
you can also reload the file into memory by using the last command on shell.
to check that the variables added to your system variables use the set command:
Variables can be used in the configuration like so:
The variables can be used anywhere.
You can pass the variable into your CGI scripts and SSI pages using mod_env by adding to your confs:
You can use apache Variables as functions using mod_macro extension,
mod_macro enables you to create macro functions with variables like:
<Macro VHost $host $port $dir> Listen $port <VirtualHost *:$port> ServerName $host DocumentRoot $dir <Directory $dir> # do something here... </Directory> # limit access to intranet subdir. <Directory $dir/intranet> order deny,allow deny from all allow from 10.0.0.0/8 </Directory> </VirtualHost> </Macro> ## Use of VHost with different arguments. Use VHost www.apache.org 80 /projects/apache/web Use VHost www.perl.com 8080 /projects/perl/web Use VHost www.ensmp.fr 1234 /projects/mines/web
* example taken from here.
check your apache version using:
centos repository have apache 2.2.15, so you’ll need to compile newer version from source which is out of the bounds of this article. if you have later version of apache you can still use mod_macro which is better solution (for me) over system variables
to download and install mod_macro type:
tar xzvf mod_macro-1.2.1.tar.gz
apxs -cia mod_macro-1.2.1/mod_macro.c
Update 1.2.1 if wget returns newer version.
read more information and view demonstration code of how to use this extension check: http://www.cri.ensmp.fr/~coelho/mod_macro/
That’s it! select the way appropriate for your apache variables…
NOTE: This article was rewritten (for CentOS 6.4). please read the updated post.
“Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Its syntax is said to be clear and expressive.” from Wikipedia.
“Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.” from https://www.djangoproject.com/