Go Down

Topic: OT: just ordered a hard-drive for my 1U server (Read 8018 times) previous topic - next topic


Mar 03, 2017, 09:56 pm Last Edit: Mar 03, 2017, 09:57 pm by MattS-UK
I was having dinner. Local Wood Pidgeon in a Madeira and red current sauce :D

Webmin installs perl but it does not install all them modules it needs.  If you try to use webmin to install the authen modules, you end up in a loop which can not be resolved within webmin.


yum install gcc perl-devel perl-CPAN perl-YAML tcp_wrappers-devel pam-devel -y

cpan sub::Uplevel
# Will trigger cpan environment initialisation.  Follow the defaults.

Code: [Select]

perl -MCPAN -e shell
  install Make::Build
  install Authen::Libwrap
  install Authen::PAM
[q]  #quit the shell

Now head to Webmin
Others, Perl Modules, Suggested Modules
Install the modules which are outstanding

Next step is to install Mariadb, which is the not-Oracle substitute for mySQL

Go ahead
yum install mariadb

That would be a good place to leave it for the evening.

I'm off to have a beer or two with the wife now but will be back in my office tomorrow AM (GMT).


Mar 04, 2017, 02:03 am Last Edit: Mar 04, 2017, 02:04 am by Chagrin
yum install tcp_wrappers-devel

(demonstrating the primary skill of a sysadmin - using google to find someone else with the same problem on ServerFault or StackExchange) :)


Yes but I made the last post yesterday after a couple glasses of wine.  Looks like you may have copied the install list before I went back and corrected it with tcp_wrappers-devel.  Sorry about that.

The suggested webmin modules are not critical unless you happen to be using the functionality which depends on those modules.  However, when I am commissioning servers the OCD kicks in.

You don't want to give me SSH access either.  Mainly because opening sshd to the internet without first taking measures to deter the drive by attacks, is a really poor idea.  But also, logging in is where I draw the line between a bit of free advice and writing an invoice ;)

Once you are finished with the perl modules, install the other maria components I forgot to mention last night
yum install mariadb-server mariadb-client -y
systemctl start mariadb
systemctl enable mariadb

Head over to Webmin, click the Refresh Modules link...Wait for it...
Voila, MySQL Database Server appears in the Servers group.


Mar 04, 2017, 10:18 am Last Edit: Mar 04, 2017, 10:22 am by MattS-UK
A word about PHP

CentOS is a clone of Red Hat Enterprise Server but without the Red Hat - Literally.  RHEL is famous for rock solid stability and one of the ways RH achieve it is by being extremely conservative with the packages they allow into the distribution repos.  The RHEL7 repo currently contains PHP v5.4. If you want to use a version later than that, you need to stop now and look elsewhere.

If you are content to accept PHP 5.4 then go ahead and install the MySQL native driver.
yum install php-mysqlnd -y

Time to install php, note that there is no -y on the command, as I want you to pause at the dependency list
yum install php

The dependency list includes httpd.  Installing php also installs Apache.

Once yum has done it's work withi php and Apache, immediately backup the files


You saw my EDIT about backing up httpd.conf and php.ini?

BTW. if you leave the backup of httpd.conf in the conf directory, make sure the extenstion is not .conf, otherwise Apache will try to load it.

Once you have backed up the defaults
systemctl start httpd
systemctl enable httpd

Head over to Webmin, refresh modules...Apache is now in the Servers group.  Do not be tempted to use the Webmin forms to configure Apache though; it is too easy to mess up the conf file.  In the Others group you find the PHP configuration forms.

A word about using Webmin.  As I said before, Webmin is an aide-memoire. It helps cut down the time trawling /etc and reading comments in conf files but it will not do the job for you as such.  Webmin works directly against the various conf files and it will not try to stop you screwing them up.  In most cases when you fill in a Webmin form, you do not try to fill in every field, but rather, you fill in the fields for the defaults you want to override.  If you do not know what a field label means, it's best not to touch it until you do.

Time for me to take a break and work up a simple httpd.conf


Attached is a simple httpd.conf file.

The contents need to reside in the file
Replacing the default.

There are two ways to get it onto your server
1. My preferred method from webmin,
  Servers, Apache Webserver, Global Configuration, Edit Config Files
  httpd.conf is open by default so go ahead and copy paste over the top
  And click Save

2. File transfer using SCP, SFTP, rsync, what have you.
  Be careful to check the permissions are not changed from
  -rw-r--r--, root root httpd.conf

Create some content

nano /var/www/html
Code: [Select]

echo "Connected to the default server at " $_SERVER['SERVER_NAME'];

Restart Apache, using webmin or with
systemctl restart httpd

Test it locally
telnet localhost 80
Code: [Select]

GET / HTTP/1.1

Note, the blank line at the end of the file.
Server should respond with a page of content in text form.

Make sure you don't have a firewall active and blocking port 80
You should be able to access the phpinfo page from your browser.

There you have it.  A rudimentary LAMP server.
You will need to secure it though.


Now it is working, you might want to back up the whole of the /etc directory.

Remember that SCP uses SSH and that means a significant overhead for the encryption at both ends, with a significant drop in throughput compared to un-encrypted protocols.  A better test of throughput is to place a large file in the /var/www/html folder and download it with a web browser.

Unless there is a physical fault on the CAT5 cable, CAT6 is unlikely to make much difference within a residential premises.


You are spending money again Travis, slap on the back of your hand.

No technical PMs.
The last thing you did is where you should start looking.


just bought and installed a new 2TB hard drive (the one i ordered i canceled as it was that or wait for back-order). it is formatting now, as i type. :D

i had envisioned having several partitions, and mount points, but i ended up just doing one partition and mount point, and i will tie stuff in with file links. it seemed easier at the time.

Just don't do what one of our customers did some time ago, and save backups to a different partition on the same disk they were backing up.

Was gold to see their face when they realized their data was gone after having the drive fail. Not sure if they forked out for forensic recovery, but its cheaper to buy a second disk.
Forum Mod anyone?


Just don't do what one of our customers did some time ago, and save backups to a different partition on the same disk they were backing up.
Reminds me of my first emergency call out.  Netware server abended during the overnight backup run and failed to remount the bindery.  I turned up with a new disk and asked for the previous day's tape.  "We only have one tape."  20 hours of VRepair, abend loop later, I managed to get the old disk back online.  In operation the system generated around 500 to 1000 Euros per hour (DMark in those days) and they had scrimped over a pack of DAT tapes.  I sent the invoice out in a jiffy bag, with a couple of 'free' tapes.

Go Up