Apache mod_status, which site uses which process and resources
If you need detailed information about Apache processes and which site is using them. Edit your httpd_conf file, and change the following directives: <Location /secret-name-server-status> SetHandler server-status Order deny,allow Deny from none Allow from all </Location> You can set Allow from [specific IP address or range] for greater security Also change un-comment the # by removing the # character: ExtendedStatus On Then, go to Listen On directives, and add an unused port: Listen 4567 Save changes, restart apache service...
read moreLinux CentOS multiple default gateway for Virtual NIC interface
If your server needs to have multiple IP addresses on the same physical NIC, you need to create multiple Virtual Interfaces. For example, the default eth0 configuration will have an IP address from one network IP block, but you need to add another IP address, from a different IP block, with a different gateway. Here are the steps to add multiple IP addresses with multiple default gateways on the same physical NIC: Create a separate file in /etc/sysconfig/network-scripts called eth0:1 or eth0:2, etc. Increment for each new IP address. File...
read moreLinux CentOS – copy .htaccess file into every subdirectory
If you need to copy a file into every sub-directory within a directory, navigate there, and run this command: find -type d -maxdepth 1 -print0 | xargs -0 -n1 cp .htaccess The maxdepth 1 switch allows you to go only 1 subdirectory deep, you can change it to 2, or 3 or leave it out altogether to copy into every subdirectory, regardless of depth. You can copy any file, not just .htaccess this way. find -type d -print0 | xargs -0 -n1 cp .htaccess This can be especially useful for WordPress media files and upload directories organized by...
read moreWindows login script to automatically map users to Samba share
If you have configured Samba to share a folder and want your Windows users to automatically connect to it do the following: Create a logon script logon.bat: net use Z: /delete net use Z: \\192.168.0.100\data In a non-domain environment Put this script in: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup on Windows 7 computers. Put this script in: C:\Documents and Settings\All Users\Start Menu\Programs\Startup on Windows XP computers. In a Windows domain environment In a Windows domain environment you can can configure Group Policy...
read moreCentOS – WordPress Uploads directory permissions
Most WordPress installations recommend to change your directory permissions to 755 on all directories. Unfortunately, this does not work on the Uploads directory, since the parent directory owner is one user, and the process that executes uploads is either the ‘apache’ user or ‘nobody’ user for PHP. Here is what we did to resolve the WordPress Uploads directory permissions problem: cd to the /wp-content directory chmod 777 uploads This will allow the apache process to create new files and directories inside the...
read moreCentOS and Apache – password protect with .htaccess and .htpasswd
To protect /stats sub-directory: Edit /home/.htpasswd file user:encryptedpassword Add .htaccess file to /home/usr/usrname/stats/.htaccess AuthUserFile /home/.htpasswd AuthGroupFile /dev/null AuthName EnterPassword AuthType Basic require user usrNAMEhere ===
read more
