Categories
Code Design Internet Linux UNIX

Enable keep-alive in Apache

What is keep alive? Keep alive is a method to allow the same tcp connection for HTTP conversation instead of opening a new one with each new request. More simply put, it is a communication between the web server and the web browser that says “you can grab more than just one file at a time”. Keep […]

Categories
Code Internet Wordpress

Browser Caching via .htaccess

I added simple browser caching through my .htaccess file. vi .htaccess IMPORTANT: Add the following to the top of the file. ## EXPIRES CACHING ## ExpiresActive On ExpiresByType image/jpg “access 1 year” ExpiresByType image/jpeg “access 1 year” ExpiresByType image/gif “access 1 year” ExpiresByType image/png “access 1 year” ExpiresByType text/css “access 1 month” ExpiresByType text/html “access 1 month” […]

Categories
Internet Linux

Enable mod_deflate On CentOS 6 (Enable Compression)

Add to .htaccess. ## ENABLE COMPRESSION ## AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-font-otf […]

Categories
Linux UNIX

Red Hat & CentOS – Setting Up Virtual Hosts

For this quick and simple example, I will enable Virtual Hosts and configure itsmetommy.com to point at /var/www/itsmetommy.com/public_html/. # vi /etc/httpd/conf/httpd.conf # mkdir /var/www/itsmetommy.com # mkdir /var/www/itsmetommy.com/public_html/ Add the below line to /private/etc/apache2/extra/httpd-vhosts.conf or you will get the below error when restarting httpd. ServerName localhost “Starting httpd: httpd: apr_sockaddr_info_get() failed for YOURHOSTNAMEhttpd: Could not reliably determine the […]