HTML

How to Redirect Web Page

Posted on
Redirect Web Pages As time goes by, we may want to change URL of website into optimized ones for search engines in order to rank higher. Furthermore, replacing old domain name into a keyword-focused one to reconstruct our URL strategies. Therefore, We need skills to redirect web pages to new URL. Here I list 5 […]
Apache

How to Resolve Too many open files AH00132: file permissions deny server access

Posted on
Saw some errors in httpd log:[Sat Jun 10 18:20:54.048569 2017] [core:error] [pid 5596] (24)Too many open files: [client 123.123.123.123:56399] AH00132: file permissions deny server access: /var/www/html/logo.png, referer: http://logic.edchen.org/Check the resource limit on open files. This includes hard limit and soft limit.[root@test ~]# ulimit -H -n4096[root@test ~]# ulimit -S -n1024It could be too small to support […]
Apache

How to Prevent Visitors From Accessing Website Via Server IP

Posted on
Visitors may sometimes access your server by a pretty raw manner which contains the most specific matching IP address. For instance, suppose the server IP is 123.123.123.123, they might access the server via http://123.123.123.123/ in any browser on purpose. If there’s no website or web page in the server document root (i.e. /var/www/html), httpd will return the […]
Apache

How to Enable Dynamic robots.txt with Virtual Hosts

Posted on
The following configuration can enable the rewrite rules of your virtual hosts and make robots.txt point to any other dynamic file (e.g. robots.php or robots.asp) which can change content dynamically.Add rewrite rules into <Directory> within the Virtual host.[root@test ~]# vi /etc/httpd/conf/httpd.conf…<VirtualHost *:80>    DocumentRoot “/var/www/html/example”    ServerName www.example.com    …    <Directory “/var/www/html/example”>        […]
Apache

How to Enable Client-Side Browser Cache on Apache Web Server

Posted on
Enabling client-side browsers to cache the web pages can speed up the response time of your visitors.According to Apache HTTP server 2.2 Module mod_expires, you can add file expiration to httpd configuration.[root@localhost ~]# vi /etc/httpd/conf/httpd.conf…<IfModule mod_expires.c>    ExpiresActive On    ExpiresDefault “access plus 1 second”    ExpiresByType application/javascript “access plus 1 week”    ExpiresByType application/x-icon […]
Apache

How to Install Newest LAMP on CentOS 7 Minimal (2/3) – Apache

Posted on
How to Install Newest LAMP on CentOS 7 Minimal (1/3) – MySQLSince the version of Apache HTTP Server provided by CentOS 7 is pretty new (2.4.6), so we use it as our httpd version of LAMP.Check what version of httpd we can have.[root@primary01 ~]# yum info httpdLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirror01.idc.hinet.net * […]
LAMP

How To Install LAMP on CentOS 6.4 – By Example

Posted on
As a developer, you may choose WAMP for development. But for testing purpose, you may want a similar environment to the production. LAMP could be a closer solution to you. In this example, we use alternative yum repositories, like CentALT, remi. You may refer to this post for more information about install alternative yum repositories:How […]