Building a secure web server with CentOS 5, part 2

Posted on 05.Jan 2010 by Ray Heffer in LAMP, Linux, Web Hosting

Part 1Part 2Part 3Troubleshooting

Part 2: Configuring the Server

Configuring CentOS

  • Edit /etc/hosts and /etc/sysconfig/network with hostnames
  • Install Packages

Example of /etc/hosts:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
67.34.32.11 www.mydomain.com

Example of /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=www.mydomain.com

Installing Packages

# yum -y install httpd openssl-devel openssl mod_ssl vsftpd rpm-build rpm-devel autoconf automake lynx gcc
# yum -y install mysql mod_auth_mysql mysql-devel mysql-server
# yum -y install mod_python python python-devel
# yum -y install perl mod_perl mod_perl-devel openssl-perl perl-Convert-ASN1 perl-Date-Calc perl-DateManip perl-HTML-Parser perl-libwww-perl perl-CPAN perl-DBD-MySQL perl-XML-Parser
# yum -y install php-devel php php-domxml php-gd php-mbstring php-mysql php-ncurses php-pear
# yum -y install webalizer
# yum -y install sendmail sendmail-cf


read more



Linux commands and tips

Posted on 07.Jul 2005 by Ray Heffer in Linux, Scripts & Commands, Tutorials

Checking kernel & CentOS version

To check which kernel version you are running use uname -r

# uname -r

To find out which CentOS (or RedHat) release is installed have a look at /etc/redhat-release

# cat /etc/redhat-release

Checking Disk Space

To check disk space used / free use the df command and it will display each volume. The -h switch turns the bytes reading into GB to make it more readable.

# df -h

If you want to check the size of a particular directory then use:

# du -sh /

read more