How to increase the MaxClients value greater than the current HARD_SERVER_LIMIT set for Apache.
1. Check if there is any hard server limit.
/usr/local/apache/bin/httpd -V | grep HARD_SERVER_LIMIT
2. Look for this directive in the Apache’s header file /usr/local/apache/include/httpd.h
3. Edit this file and increase the HARD_SERVER_LIMIT as per your requirement.
4. Recompile Apache using
5. There you will have an option to increase the Apache HARD_SERVER_LIMIT, since easyapache looks for the header files and sees the new value while build. By default the MaxClients value will be 256.
Once the build completes, you can see the new HARD_SERVER_LIMIT.
Tags: Apache, HARD_SERVER_LIMIT
How to redirect port using IPTABLES
You can redirect the port in IPTABLES using the prerouting parameter.
Following is the command you can use to redirect the traffic of the SMTP server port 587 to port 25.
This is very useful when your ISP may have the SMTP port 25 blocked so you need an additional SMTP port to connect to send emails.
iptables -t nat -I PREROUTING -p tcp –dport 587 -j REDIRECT –to-port 25
Then Run iptables save
/etc/init.d/iptables save
Restart Iptables
/etc/init.d/iptables restart
Tags: iptables, redirect port
How to install VNC Server.
For RHEL5 or Centos
yum groupinstall “KDE (K Desktop Environment)”
yum install vncserver
Edit the lines below in the file /etc/sysconfig/vncservers and add a user “test1″
(user should be a valid user).
VNCSERVERS=”1:test1″
VNCSERVERARGS[1]=”-geometry 1024×768 -depth 16″
To add more users, just add the lines in the next box below for second user. You can continue with more number of users.
Now the port for user one is 5900+1=5901, The port for user two is 5900+2=5902 and so on.
VNCSERVERS=”2:newuser”
VNCSERVERARGS[2]=”-geometry 1024×768 -depth 16″
Add a password
$ vncpasswd
Password:
Verify:
Edit the startup script
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
/etc/X11/xinit/xinitrc: Bourne-Again shell script text executable
Go for Reboot. When the server is back type the command below to start the VNC server.
Connect to VNC server from your local machine.
(Dont forge to allow 5901 in your firewall.)
Now you can login using the login created previously.
Tags: VNC Server.
Using SFTP if the default ssh port is changed
Usually if the SFTP is enabled in your server, it will try to use the default SSH port (port 22) even though the SSH service may be running on another SSH port (ie: port 2222).
In this case, the SSH port is running on 2222.
Since SFTP will attempt to connect to port 22, you will have to specify a non-default port for SSH connections so SFTP can issue a proper connection to the remote destination. You can accomplish this by running the following command.
#sftp -oPort=2222 root@Server-IP-address
Tags: change sftp port, SFTP, ssh port
How to install Mytop in Plesk servers
Mytop is a Perl program which allows to monitor MySQL servers by viewing active threads, queries and overall server performance numbers.
mytop is a `top’ clone for MySQL
mytop is a console-based (non-gui) tool for monitoring the threads and overall performance of MySQL 3.22.x, 3.23.x, and 4.x servers. It runs on most Unix systems which have Perl, DBI, and Term::ReadKey installed. And with Term::ANSIColor installed you even get color. As of version 0.7, it even runs on Windows (somewhat).
INSTALLATION
tar -zxvf mytop-.tar.gz
cd mytop-
perl Makefile.PL
make
make test
make install
Now installation is over. If you run mytop command, it won’t work in Plesk servers. You need to make some configurations in “~/.mytop” file. Create a file called ~/.mytop and add the below entries in “~/.mytop” file.
$ touch ~/.mytop
$ vi ~/.mytop
user=admin
pass=your mysql password
host=localhost
db=psa
delay=5
port=3306
socket=
batchmode=0
header=1
color=1
idle=1
Run the mytop command
$ mytop -u admin -p(Your Mysql password)
Now you can see the overall performance of your MySQL server.
Tags: Mytop, plesk