Latest blog entry

ERROR: Can’t open or parse the config freshclam.conf

January 28, 2014    |   Posted by admin   |    Category: Linux Administration

While updating the ClamAV database using the ‘freshclam’ command, you may receive the “can’t open or parse the config file freshclam.conf” message.

root@vps:~# freshclam
ERROR: Please edit example config file /usr/local/etc/freshclam.conf
ERROR: Can't open/parse the config file /usr/local/etc/freshclam.conf

The reason is, with the default installation, the ‘Example’ variable is set to On which makes the configuration file work as a example and not the real configuration file.

To fix the issue, edit the freshclam.conf file

# nano /usr/local/etc/freshclam.conf

and remove or comment the line that says ‘Example’.

#Example

Save the file and execute the freshclam command to update the ClamAV database.

Comments Off on ERROR: Can’t open or parse the config freshclam.conf

How to make Tomcat work on port 80 instead of 8080?

January 11, 2014    |   Posted by admin   |    Category: cPanel Management, Linux Administration

Sometimes people host applications that are fully Java based and don’t require a Webserver to access their application. However, in such a case, the application has to be accessed with port 8080 i.e. http://domainname:8080 which is not feasible.

There are 2 ways for the Java application to work on port 80, so people don’t have to mention port 8080 in their URL We will take a look at each of the above 2 options below:

1. The easiest way is to change the Tomcat port from port 8080 to 80 in the conf/server.xml file. This file is inside the Tomcat folder. 

To locate the file, update the mlocate database first (this command will take sometime to complete):

# updatedb

now, search the server.xml file using the locate command:

# locate server.xml

Open the file in the edit mode

# nano server.xml

and search for the below section

<Connector port="8080" Protocol="HTTP"
maxHttpHeaderSize="8192"
connectionTimeout="20000"
/>

Replace port 8080 with 80 and restart the Tomcat service.

2. The second method is to use iptables rules to redirect traffic received on port 80 to port 8080.

To add the iptables redirect rules, SSH to your server as root and execute the below commands:

# iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
# iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j \
REDIRECT --to-port 8080

To make the rules permanent

# service iptables save

Applying any of the above 2 methods will make the Java application work without the use of port 8080 in the URL.

Comments Off on How to make Tomcat work on port 80 instead of 8080?