Posts tagged bgevolution
Hostnames – Strategic and Secure Naming
Dec 20th
I have 4 system in my house. The primary I label serverhost. On the serverhost the /etc/hostnames file is the same as the hostnames file on the other machines. The hostnames file is formatted accordingly:
##/etc/hostnames
192.168.1.100 serverhost.bgevolution.com serverhost
192.168.1.101 server.bgevolution.com server
192.168.0.102 tv.bgevolution.com tv
192.168.0.103 server2.bgevolution.com server2
Server 2 is new. I can further cleanup the schema by changing the static address of tv to 103 and server2 to 102. But for now its ok. Now I can reference hosts, with the respective ip address, simply by hostname. This is convenient for setting permissions. Permissions can be a pain in the neck, and if you are referencing a host by ip, localhost, and or the hostname you will have to create permissions for each. For example your mysql server will need permissions for each hostname that you want to connect to it with. Connecting to the server from the serverhost I need permissions for username@serverhost.bgevolution.com. But if I am connecting to mysql through phpmyadmin I need permissions for username@server.bgevolution.com.
I have replicated the mysql server on server to server2, which I connect to with the phpmyadmin installation on server. On server2 I must give permissions to username@server.bgevolution.com to be able to connect from the server. Ultimately with no experience dealing with permissions it is a pain, but after getting everything running you will realize that it makes sense, and it does increase security.
I want the slave server to also behave as the master, and ultimately I want to experiment with setting up a round robin mysql server, meaning as http requests come in to the website, I want it to randomly access database information from either server or server2. This should prove fun.
Sendmail – Consolidate Multiple Domains
Aug 26th
Sendmail has the virtusertable configuration file, that is built into the virtusertable.db file. The purpose of this file is to direct incoming email, for a particular domain, to a particular user. If you have multiple domains, you can separate the email login proceedures by specifying a different user name for each respective domain. Such a configuration would look like this:
@bgevolution.com bgevolution
@nodomain.com nodomain
In this type of configuration you would have a user “bgevolution” and a user “nodomain”, and you will be able to login to Dovecot separately for each one. Another configuration consolidates things a bit:
@bgevolution.com primaryuser
@nodomain.com primaryuser
In this configuration you will be able to login to Dovecot, as primaryuser, which will contain all mail sent to both bgevolution.com and nodomain.com. Also note that in these examples I have used no text prior to the “@” symbol. In this way your Sendmail will catch all incoming mail to either domain. If you want to restrict things a bit you can add your username; in this way only email, coming specifically to that user name, will be accepted.
Apache Mod – Cband
Aug 23rd
The Cband Apache module can be downloded from the official website here:
This module provides full bandwith limiting of all Apache VirtualHosts. First reference the newly added module with:
LoadModule cband_module /etc/apache2/mod_cband.so
You can put the module anywhere you want, just adjust the directory location accordingly. Now you can add a VirtualHost as usually, and add the addition cband configuration parameters to establish desired functionality.
<VirtualHost *>
ServerName www.bgevolution.com
ServerAdmin admin@bgevolution.com
DocumentRoot /home/user/bgevolution/
CBandSpeed 5000kb/s 24 16
CBandRemoteSpeed 2500 12 8
</VirtualHost>
The CbandSpeed parameter established a maximum bandwidth limit on the entire VirtualHost. The 24 refers to the maximum requests per second, and the 16 refers to the maximum sustained connections at any one time. The CbandRemoteSpeed parameter establish bandwidth throttling for any one specific website visitor. With this parameter you can limit each visitor specifically. Play around with the numbers, try and download something, and you will see in real time the effect your configuration has on the actual download speed.

