How to setup your Linode with CentOS

How to setup your Linode with CentOS

by Craig Spurrier of Craigweb

Based off of How To Set Up Your Server on Linode by schof and neorder.

CentOS is a distro based off of Red Hat Linux Enterprise Server.

Step One

Create a directory to work in, then switch to it.

mkdir work
cd work

Step two

Install APT, the Debian package tools. Yes, you can you yum or any of the other packaging tools, I however learned to use APT first so that is what this guide uses.

wget ftp://ftp.pbone.net/mirror/dag.wieers.com/packages/apt/apt-0.5.15cnc6-3.1.el3.dag.i386.rpm 
rpm -Uvh apt*

Step Three

Update the sources file

Run

 apt-get update 

Step Four

Upgrade to the lastest version of any installed programs.

Run

 apt-get upgrade 

Step Five

Update your hostname

 echo yourdomainnamehere >/etc/hostname  
 /bin/hostname -F /etc/hostname 

Step Six

Install Net-SSLeay the Perl module that allows secure access to webmin.

wget ftp://ftp.freshrpms.net/pub/dag/packages/perl-Net-SSLeay/perl-Net-SSLeay-1.23-0.dag.rhel3.i386.rpm
rpm -Uvh perl*

Step Seven

Test your install````
perl -e 'use Net::SSLeay'

No output means success.

****Step Eight****

Install Webmin

wget http://aleron.dl.sourceforge.net/sourceforge/webadmin/webmin-1.180-1.noarch.rpm
rpm -Uvh webmin*

````

Step Nine

On your local computer point your web browser to https://yourdomain.com:10000 login as root.

Step Ten

Click Servers –> Apache and follow the prompts

Click Start Apache (at the top)

Step Eleven

On your local computer point your web browser to http://yourdomain.com you should see a test page if you do your website is now working.

Step Twelve

Set Apache to start on boot.

Click on System –> Bootup and Shutdown. Put a chek by httpd and click start select on boot.

Step Thirteen

Set up E-mail, Virtualmin, Ftp, Etc.

Enjoy your new server!

If any one needs help please reply.

11 Replies

Advanced:

You can also run these steps as two big ones just copy and paste.

mkdir work
cd work
wget ftp://ftp.freshrpms.net/pub/dag/packages/apt/apt-0.5.15cnc6-3.1.el3.dag.i386.rpm
rpm -Uvh apt*
apt-get update
apt-get upgrade 
echo yourdomainnamehere >/etc/hostname  
 /bin/hostname -F /etc/hostname 
wget ftp://ftp.freshrpms.net/pub/dag/packages/perl-Net-SSLeay/perl-Net-SSLeay-1.23-0.dag.rhel3.i386.rpm
rpm -Uvh perl*
perl -e 'use Net::SSLeay'
wget http://aleron.dl.sourceforge.net/sourceforge/webadmin/webmin-1.150-1.noarch.rpm
rpm -Uvh webmin*

On your local computer point your web browser to https://yourdomain.com:10000 login as root.

Click Servers –> Apache and follow the prompts

Click Start Apache (at the top)

On your local computer point your web browser to http://yourdomain.com you should see a test page if you do your website is now working.

Set Apache to start on boot.

Click on System --> Bootup and Shutdown. Put a chek by httpd and click start select on boot.

Set up E-mail, Virtualmin, Ftp, Etc.

@CSpurrier:

On your local computer point your web browser to https://yourdomain.com:10000 login as root.

Click Servers –> Apache and follow the prompts

Click Start Apache (at the top)

On your local computer point your web browser to http://yourdomain.com you should see a test page if you do your website is now working.

Set Apache to start on boot.

Click on System --> Bootup and Shutdown. Put a chek by httpd and click start select on boot.

Set up E-mail, Virtualmin, Ftp, Etc.

I've had some log entries recently showing someone trying port 10000 as root.

Suggestion: do this after upgrading the Debian webmin to fix the recently discovered security vulnerabilities:

http://www.debian.org/security/2004/dsa-526

Then ssh into your linode and do

/etc/init.d/webmin stop

and use update-rc.d to keep webmin from starting on boot, so no one can use webmin to connect to your linode as root from the outside.

Hello,

I would recommend that you do not follow fieschko's advice, It will disable automatic loading of Webmin. I do not think Webmin is that useful without it being able to be booted on start. You will then have to start Webmin manually every-time you wish to use it.

The Security Advisory you linked to applies to Webmin 1.140 the directions above install Webmin 1.150. Make sure you remember CentOS, is Red Hat based not Debian based this issue does apply to CentOS but not Debian Security Advisorys all will. (I know you know this but I want to make sure any one reading this also knows).

Two things that can help secure Webmin.

Changing Webmin Passwords from the Command Line

Generally, once Webmin is installed all configuration of Webmin can be performed from within Webmin. However, there are a few things that can lead to being unable to log in. A common question is how to log in if you've forgotten the Webmin administrator password. If you have root access to the machine in question (i.e. you haven't also forgotten your system password), you can use the changepass.pl tool, that is found in the same directory as all of the other Webmin executable files (this is the directory in which you installed Webmin). For example, to use changepass.pl to change the root password, you could use the following command:

./changepass.pl /etc/webmin root newpassword

In the preceding example, the first option should be the directory where your Webmin configuration files are located. The second is the login name of the user whose password you'd like to change. The third is what you'd like the password to be changed to. Note that this script only works if you are logged in as the system root user, and can change any Webmin users password.

Changing the Webmin Port from the Command Line

Another problem after installation may be that a firewall prevents access to the Webmin port from across a WAN link (if, for example, you are remotely maintaining your Webmin server). If this is the case, you will want to consult with the firewall administrator to find out whether port 10000 can be opened, or if not, what port you can use for your Webmin installation. Changing the port on which Webmin runs after installation is also a pretty simple process. Simply edit the file miniserv.conf in the /etc directory where your Webmin configuration files were installed (this is likely one of the following: /etc/webmin, /usr/local/webmin/etc, or /opt/webmin/etc). You'll find a port directive. Change this to whatever port you need Webmin to listen on, and then restart the Webmin web server.

From http://www.swelltech.com/support/webmin … ngpassword">http://www.swelltech.com/support/webminguide/ch01.html#wmchangingpassword

Updated for new version of Webmin

I would add that to save a lot of time figuring out why some things don't work to add these steps right away.

To update the CentOS to the current version which today is CentOS 3.3:

yum check-update
yum update

To fix why some things like host, nslookup and Bind named don't work on the first install of CentOS:

mv /lib/tls /lib/tls-disabled

Then you can find ready made rpms for CentOS at this URL:

http://mirror.centos.org/centos-3/

could you elaborate more on setting up the following type of servers for Centos 4

1. mailserver (smtp & pop3) dont care about imap right now

and maybe some information about how to install / update php, etc ..

since centos5 uses yum, not apt.

Tip: If you plan on running a standard Virtualmin setup just run the Virtualmin install script on a fresh CentOS image. It installs everything automatically and does a very basic configuration. See http://www.webmin.com/vinstall.html for details. The steps are roughly: first boot -> ssh login as root -> run 'yum -y update' (optional) -> wget install.sh (get url from link above) -> chmod +x install.sh -> run install.sh -> hit 'y' and wait -> login to webmin and update config -> reboot and the VPS should be ready for use. It doesn't get much simpler than that with the free control panels.

@MegaBurn:

Tip: If you plan on running a standard Virtualmin setup just run the Virtualmin install script on a fresh CentOS image. It installs everything automatically and does a very basic configuration. See http://www.webmin.com/vinstall.html for details. The steps are roughly: first boot -> ssh login as root -> run 'yum -y update' (optional) -> wget install.sh (get url from link above) -> chmod +x install.sh -> run install.sh -> hit 'y' and wait -> login to webmin and update config -> reboot and the VPS should be ready for use. It doesn't get much simpler than that with the free control panels.

Thanks for the tip. I followed it exactly and I now have Virtualmin installed on a fresh CentOS image. I updated the hostname to "lixx-xxx.members.linode.com"

However, I cannot access webmin on port 10000. I get a "network timeout." Currently, I am trying to access it via:

https://lixx-xxx.members.linode.com:10000

UPDATE: I can login to usermin via port 20000. Still can't login to webmin, though.

I would appreciate any tips.

Thanks,

parksobong

The command 'netstat -nvltuw' will show listening servers on your machine; run it and see if anything is listening on 10000. (If lsof is installed on your system, 'lsof -Pni' will show similar information plus, very usefully, the name of the listening command. You'll need to be root to run it, though.)

If webmin is listening, you should look at your firewall settings to make sure you're not blocking connections to port 10000.

Linode support helped me figure this out. It was my ISP blocking port 10000. Thanks all.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct